Localization refactoring:

* the front-end now use global constants, based on the translation key
* build-client.js use the ESBuild "define" directive to replace these
  globals at compile time, by the english value
* build:client must now be called after build:languages
* moving the loadLoc and loc backend functions in a separate lib
This commit is contained in:
John Livingston
2023-06-12 19:26:28 +02:00
parent 7285c8b0a8
commit f73ccbbf7e
12 changed files with 199 additions and 93 deletions

View File

@ -100,12 +100,12 @@ function register ({ registerHook, registerSettingsScript, peertubeHelpers }: Re
table.classList.add('peertube-plugin-livechat-prosody-list-rooms')
container.append(table)
const labels: any = {
RoomName: await peertubeHelpers.translate('Room name'),
RoomDescription: await peertubeHelpers.translate('Room description'),
NotFound: await peertubeHelpers.translate('Not found'),
Video: await peertubeHelpers.translate('Video'),
Channel: await peertubeHelpers.translate('Channel'),
LastActivity: await peertubeHelpers.translate('Last activity')
RoomName: await peertubeHelpers.translate(LOC_ROOM_NAME),
RoomDescription: await peertubeHelpers.translate(LOC_ROOM_DESCRIPTION),
NotFound: await peertubeHelpers.translate(LOC_NOT_FOUND),
Video: await peertubeHelpers.translate(LOC_VIDEO),
Channel: await peertubeHelpers.translate(LOC_CHANNEL),
LastActivity: await peertubeHelpers.translate(LOC_LAST_ACTIVITY)
}
const titleLineEl = document.createElement('tr')