-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Translation pt br #1238
base: master
Are you sure you want to change the base?
Translation pt br #1238
Conversation
WalkthroughThis pull request introduces localization enhancements across multiple components, including Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 9
🧹 Outside diff range and nitpick comments (2)
apps/client/src/translation/TranslationProvider.tsx (1)
29-29
: LGTM: Brazilian Portuguese added to translationsList.The 'ptbr' entry has been correctly added to the
translationsList
object, mapping to the importedlangPtbr
.Consider maintaining alphabetical order in the
translationsList
object for consistency and easier maintenance. You might want to move the 'ptbr' entry just after the 'pt' entry.apps/client/src/features/operator/status-bar/StatusBarTimers.tsx (1)
75-75
: Consider consistency in localization key namingThe localization key for the "Running timer" label uses a different prefix ('countdown.running') compared to the other labels that use 'common.*'. While this isn't necessarily wrong, it might be worth considering consistency across your localization keys.
If "Running timer" is a common term used across the application, you might want to change it to 'common.running_timer' for consistency:
- <span className={styles.label}>{getLocalizedString('countdown.running')}</span> + <span className={styles.label}>{getLocalizedString('common.running_timer')}</span>However, if it's specific to the countdown feature, the current key is appropriate. In that case, consider adding a comment explaining why this key is different from the others.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (12)
- apps/client/src/features/app-settings/panel/general-panel/GeneralPanelForm.tsx (1 hunks)
- apps/client/src/features/operator/status-bar/StatusBarTimers.tsx (3 hunks)
- apps/client/src/translation/TranslationProvider.tsx (4 hunks)
- apps/client/src/translation/languages/de.ts (1 hunks)
- apps/client/src/translation/languages/en.ts (1 hunks)
- apps/client/src/translation/languages/es.ts (1 hunks)
- apps/client/src/translation/languages/fr.ts (1 hunks)
- apps/client/src/translation/languages/hu.ts (1 hunks)
- apps/client/src/translation/languages/it.ts (1 hunks)
- apps/client/src/translation/languages/no.ts (1 hunks)
- apps/client/src/translation/languages/pl.ts (1 hunks)
- apps/client/src/translation/languages/pt-br.ts (1 hunks)
🔇 Additional comments (18)
apps/client/src/translation/languages/no.ts (2)
16-16
:⚠️ Potential issueFix spelling and provide Norwegian translation
There are a couple of issues with the newly added translation:
- There's a spelling error in the key: 'commom' should be 'common'.
- The value is in English, but this file is for Norwegian translations.
Please apply the following changes:
- 'commom.elapsed_time': 'Elapsed Time', + 'common.elapsed_time': 'Forløpt tid',Note: I've provided a suggested Norwegian translation, but please verify with a native Norwegian speaker or professional translator to ensure accuracy.
To ensure consistency and proper usage, let's check for any existing usages of this key in the codebase:
#!/bin/bash # Search for usages of 'common.elapsed_time' or 'commom.elapsed_time' in the codebase rg -i "('|\")comm?om\.elapsed_time('|\")"This will help identify any places where the key is already being used, which might need updating.
16-16
: Ensure consistency with translation structure and styleWhile adding the new translation, please consider the following:
- Verify that 'common.elapsed_time' is defined in the English translation file (
en.ts
) to maintain consistency across language files.- Ensure the Norwegian translation aligns with the terminology and style used in other translations. For example, 'time' is translated as 'tid' in other entries.
To check the consistency with the English file and other usages, run the following script:
This will help ensure that the new translation fits well with the existing structure and terminology.
apps/client/src/translation/languages/en.ts (2)
Line range hint
1-30
: LGTM: Good placement and structureThe new translation key is well-placed within the 'common' group, maintaining the file's logical structure. The overall consistency of the file is preserved, and the
TranslationObject
type correctly ensures type safety for the translations.
Line range hint
1-30
: Clarify PR objectives vs. actual changesThe PR description mentions adding Brazilian Portuguese language support and incorporating translator codes into the operator's view. However, the changes we see here are limited to adding a new English translation key. Could you please clarify:
- Where are the Brazilian Portuguese translations added?
- Where are the changes related to translator codes in the operator's view?
- Is this addition to the English translations file intentional and part of the PR objectives?
This will help ensure that all intended changes are properly reviewed and implemented.
To help verify the extent of changes, you can run the following script:
apps/client/src/translation/languages/it.ts (1)
Line range hint
1-30
: Ensure PR changes align with stated objectivesThe changes in this file (adding an Italian translation) don't seem to align with the PR objectives of adding Brazilian Portuguese translations and translator codes to the operator's view. It's important to maintain focus and consistency in pull requests to facilitate easier review and integration.
Let's verify if there are any changes related to Brazilian Portuguese translations:
If these searches don't yield results, it might indicate that the PR description doesn't accurately reflect the changes made. Please ensure that all changes are relevant to the PR's stated objectives, or update the PR description to accurately reflect the changes made.
apps/client/src/translation/languages/es.ts (2)
Line range hint
1-30
: LGTM for the rest of the fileThe remainder of the file looks good. The structure is consistent, and the translations appear to be correct Spanish translations for the given keys.
Line range hint
1-30
: Clarify PR scope and file relevanceI noticed a discrepancy between the PR objectives and the file being reviewed:
- The PR title and description mention adding Brazilian Portuguese translations.
- However, this file (
es.ts
) contains Spanish translations.Could you please clarify:
- Is this Spanish file intended to be part of this PR?
- If so, what is the relationship between the Spanish translations and the stated objective of adding Brazilian Portuguese?
- Are there other files in this PR that contain the Brazilian Portuguese translations?
This clarification will help ensure that the PR accurately reflects its intended changes and that all necessary files are included and reviewed.
To help verify the PR contents, you can run the following script:
apps/client/src/translation/languages/de.ts (1)
Line range hint
1-30
: LGTM for the rest of the fileThe structure and content of the German translation file are appropriate and consistent, aside from the issue mentioned in the previous comment.
apps/client/src/translation/languages/pt-br.ts (4)
1-3
: LGTM: Import and type declaration look good.The import of
TranslationObject
from the English language file and the type declaration forlangPtbr
are correct and consistent with the expected structure for language files.
4-15
: LGTM: Common translations look accurate.The translations for common terms and phrases appear to be correct and consistent with Brazilian Portuguese.
17-27
: LGTM: Countdown and timeline translations are accurate.The translations for countdown and timeline sections are correct and consistent with Brazilian Portuguese.
1-27
: Overall, great job on the Brazilian Portuguese translations!The file is well-structured and consistent with other language files. The translations are accurate and cover all necessary phrases. There's just one minor typo to fix in the 'common.elapsed_time' key.
Great work on enhancing the multilingual capabilities of the system!
apps/client/src/translation/TranslationProvider.tsx (2)
5-5
: LGTM: Brazilian Portuguese language import added correctly.The import statement for
langPtbr
is properly placed and follows the established naming convention and file path pattern for language imports.
66-74
: Interface structure looks good, but placement needs review.The
StatusBarTimersProps
interface is well-defined with appropriate types and optional properties. However, its placement in the TranslationProvider file seems unexpected.Could you clarify why this interface is being added to the TranslationProvider file? It appears to be unrelated to translation functionality. Consider moving it to a more appropriate location, such as a file dedicated to StatusBar components or types.
To verify the usage and potential better placement of this interface, let's run the following script:
This script will help us understand where
StatusBarTimersProps
is being used and if there are more suitable files for its placement.apps/client/src/features/operator/status-bar/StatusBarTimers.tsx (4)
29-30
: LGTM: Proper usage of useTranslation hookThe destructuring of
getLocalizedString
from theuseTranslation
hook is correctly implemented. This sets up the component for internationalization, allowing for easy translation of strings.
67-67
: LGTM: Proper localization of "Time now" labelThe hardcoded string for the "Time now" label has been correctly replaced with a call to
getLocalizedString
. The key 'common.time_now' is appropriate and consistent with common internationalization practices.
81-81
: LGTM: Proper localization of "Scheduled start" and "Scheduled end" labelsThe hardcoded strings for the "Scheduled start" and "Scheduled end" labels have been correctly replaced with calls to
getLocalizedString
. The keys 'common.scheduled_start' and 'common.scheduled_end' are appropriate and consistent with the naming pattern used for other common strings.Also applies to: 85-85
Line range hint
1-89
: Overall assessment: Good implementation of internationalizationThe changes made to this component successfully implement internationalization, allowing for easier translation of the UI. Most of the changes are well-implemented, with only a few minor issues:
- The import path for
useTranslation
is unnecessarily complex and could be simplified.- There's a typo in the localization key for "Elapsed time" ('commom' instead of 'common').
- There's a slight inconsistency in the naming of the "Running timer" localization key.
Once these minor issues are addressed, the internationalization implementation in this component will be excellent. Great job on improving the multilingual support of the application!
@@ -11,6 +11,7 @@ export const langEn = { | |||
'common.stage_timer': 'Stage Timer', | |||
'common.started_at': 'Started At', | |||
'common.time_now': 'Time now', | |||
'commom.elapsed_time': 'Elapsed Time', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo in the new translation key
There's a typo in the newly added translation key. It should be 'common.elapsed_time' instead of 'commom.elapsed_time'.
Please apply the following change:
- 'commom.elapsed_time': 'Elapsed Time',
+ 'common.elapsed_time': 'Elapsed Time',
This will ensure consistency with other keys in the object that use 'common' as a prefix.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'commom.elapsed_time': 'Elapsed Time', | |
'common.elapsed_time': 'Elapsed Time', |
@@ -13,6 +13,7 @@ export const langHu: TranslationObject = { | |||
'common.stage_timer': 'Színpadi időzítő', | |||
'common.started_at': 'Kezdődött', | |||
'common.time_now': 'Jelenlegi idő', | |||
'commom.elapsed_time': 'Elapsed Time', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Fix the key typo across all translation files and ensure proper translations
The key 'commom.elapsed_time'
contains a typo and should be corrected to 'common.elapsed_time'
in all translation files. Additionally, ensure that the value for each language is appropriately translated.
Issues Identified:
-
Key Typo:
'commom.elapsed_time'
should be'common.elapsed_time'
in all files:pl.ts
pt-br.ts
no.ts
it.ts
fr.ts
hu.ts
en.ts
es.ts
de.ts
-
Incomplete Translations:
- Except for
pt-br.ts
, the value'Elapsed Time'
is in English. These should be translated to the respective languages.
- Except for
Suggested Changes:
- 'commom.elapsed_time': 'Elapsed Time',
+ 'common.elapsed_time': '<Translated Value>',
Replace <Translated Value>
with the appropriate translation for each language.
🔗 Analysis chain
Correct the key typo and provide Hungarian translation
There are two issues with the newly added translation:
- The key contains a typo: 'commom.elapsed_time' should be 'common.elapsed_time'.
- The value 'Elapsed Time' is in English, not Hungarian, which is inconsistent with the rest of the file.
Please apply the following changes:
- Correct the key spelling.
- Provide the Hungarian translation for 'Elapsed Time'.
Here's a suggested correction (please verify the Hungarian translation):
- 'commom.elapsed_time': 'Elapsed Time',
+ 'common.elapsed_time': 'Eltelt idő',
To ensure consistency across the codebase, let's check for any other occurrences of 'elapsed_time' in translation files:
This will help us verify if the correct key is used in other language files and if they all have proper translations.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for 'elapsed_time' in all translation files
rg --type typescript 'elapsed_time' apps/client/src/translation/languages/
Length of output: 109
Script:
#!/bin/bash
# Search for 'elapsed_time' in all TypeScript translation files
rg --type ts 'elapsed_time' apps/client/src/translation/languages/
Length of output: 835
@@ -13,6 +13,7 @@ export const langIt: TranslationObject = { | |||
'common.stage_timer': 'Orologio Palco', | |||
'common.started_at': 'Iniziato Alle', | |||
'common.time_now': 'Ora attuale', | |||
'commom.elapsed_time': 'Elapsed Time', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Fix typos and translations across all language files
Several issues were found with the translation keys and values across multiple language files:
- Typo in key: The key
'commom.elapsed_time'
should be corrected to'common.elapsed_time'
in all language files to maintain consistency. - Missing translations: The value for
'commom.elapsed_time'
is in English ('Elapsed Time'
) instead of the respective languages, except forpt-br.ts
which has the correct Portuguese translation.
Affected files:
apps/client/src/translation/languages/pt-br.ts
apps/client/src/translation/languages/pl.ts
apps/client/src/translation/languages/no.ts
apps/client/src/translation/languages/it.ts
apps/client/src/translation/languages/fr.ts
apps/client/src/translation/languages/hu.ts
apps/client/src/translation/languages/en.ts
apps/client/src/translation/languages/es.ts
apps/client/src/translation/languages/de.ts
Actions needed:
- Correct the key to
'common.elapsed_time'
in all affected language files. - Provide appropriate translations for
'Elapsed Time'
in each language file to ensure proper localization.
Suggested correction example:
- 'commom.elapsed_time': 'Elapsed Time',
+ 'common.elapsed_time': 'Tempo trascorso',
🔗 Analysis chain
Fix typo and translation, and clarify relevance to PR objectives
There are several issues with this new addition:
- There's a typo in the key: 'commom' should be 'common' to maintain consistency with other keys.
- The value 'Elapsed Time' is in English, not Italian. It should be translated to Italian.
- This change doesn't seem to align with the PR objectives of adding Brazilian Portuguese translations and translator codes.
Please address these issues:
- Correct the key to 'common.elapsed_time'.
- Translate 'Elapsed Time' to Italian.
- Clarify how this change relates to the PR objectives or consider removing it if it's not relevant.
Here's a suggested correction for the Italian translation:
- 'commom.elapsed_time': 'Elapsed Time',
+ 'common.elapsed_time': 'Tempo trascorso',
To ensure consistency and completeness, let's check for similar keys in other language files:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for 'elapsed_time' key in all language files
rg --type typescript 'elapsed_time' apps/client/src/translation/languages/
Length of output: 564
Script:
#!/bin/bash
# Search for both correct and incorrect 'elapsed_time' keys in all TypeScript language files
rg --type typescript '(commom|common)\.elapsed_time' apps/client/src/translation/languages/
Length of output: 128
Script:
#!/bin/bash
# Search for both correct and incorrect 'elapsed_time' keys in all TypeScript (.ts) language files
rg -g "*.ts" '(commom|common)\.elapsed_time' apps/client/src/translation/languages/
Length of output: 854
@@ -13,6 +13,7 @@ export const langEs: TranslationObject = { | |||
'common.stage_timer': 'Temporizador de presentador', | |||
'common.started_at': 'Iniciado en', | |||
'common.time_now': 'Ahora', | |||
'commom.elapsed_time': 'Elapsed Time', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typographical error and provide Spanish translation
There are a few issues with the new translation entry:
- There's a typographical error in the key: 'commom' should be 'common'.
- The value 'Elapsed Time' is in English, not Spanish.
- This inconsistency breaks the pattern established by other entries.
Please apply the following changes:
- 'commom.elapsed_time': 'Elapsed Time',
+ 'common.elapsed_time': 'Tiempo transcurrido',
This correction:
- Fixes the typo in the key
- Provides the correct Spanish translation
- Maintains consistency with other entries in the file
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'commom.elapsed_time': 'Elapsed Time', | |
'common.elapsed_time': 'Tiempo transcurrido', |
@@ -13,6 +13,7 @@ export const langDe: TranslationObject = { | |||
'common.stage_timer': 'Bühnen-Timer', | |||
'common.started_at': 'Gestartet am', | |||
'common.time_now': 'Aktuelle Zeit', | |||
'commom.elapsed_time': 'Elapsed Time', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo and provide German translation for 'elapsed time'
There are a few issues with this new translation entry:
- There's a typo in the key: 'commom' should be 'common'.
- The translation is in English, not German.
- This change seems unrelated to the PR's objective of adding Brazilian Portuguese translations.
Please apply the following changes:
- 'commom.elapsed_time': 'Elapsed Time',
+ 'common.elapsed_time': 'Verstrichene Zeit',
Also, consider moving this addition to a separate PR focused on updating German translations, as it's unrelated to the current PR's objective of adding Brazilian Portuguese support.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'commom.elapsed_time': 'Elapsed Time', | |
'common.elapsed_time': 'Verstrichene Zeit', |
'common.stage_timer': 'TEMPO DO APRESENTADOR', | ||
'common.started_at': 'INICIADO ÀS', | ||
'common.time_now': 'HORA ATUAL', | ||
'commom.elapsed_time': 'TEMPO CORRIDO', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo in translation key.
There's a typo in the key 'commom.elapsed_time'. It should be 'common.elapsed_time'.
Please apply the following change:
- 'commom.elapsed_time': 'TEMPO CORRIDO',
+ 'common.elapsed_time': 'TEMPO CORRIDO',
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'commom.elapsed_time': 'TEMPO CORRIDO', | |
'common.elapsed_time': 'TEMPO CORRIDO', |
@@ -8,6 +8,7 @@ import ClockTime from '../../viewers/common/clock-time/ClockTime'; | |||
import RunningTime from '../../viewers/common/running-time/RunningTime'; | |||
|
|||
import styles from './StatusBar.module.scss'; | |||
import { useTranslation } from '../../../../../client/src/translation/TranslationProvider'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider simplifying the import path for useTranslation
The current import path '../../../../../client/src/translation/TranslationProvider'
seems unnecessarily long and complex. This could make the code harder to maintain and may indicate an issue with the project structure or import resolution.
Consider simplifying this import path. You might be able to use a shorter path or set up path aliases in your project configuration to make imports more manageable. For example:
import { useTranslation } from '@/translation/TranslationProvider';
This assumes you've set up path aliases in your TypeScript or webpack configuration.
<ClockTime className={styles.timer} value={clock} /> | ||
</div> | ||
<div className={styles.elapsedTime}> | ||
<span className={styles.label}>Elapsed time</span> | ||
<span className={styles.label}>{getLocalizedString('commom.elapsed_time')}</span> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typo in localization key for "Elapsed time"
There's a typo in the localization key for the "Elapsed time" label. The current key is 'commom.elapsed_time', which should be 'common.elapsed_time'.
Please correct the typo to ensure proper translation:
- <span className={styles.label}>{getLocalizedString('commom.elapsed_time')}</span>
+ <span className={styles.label}>{getLocalizedString('common.elapsed_time')}</span>
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
<span className={styles.label}>{getLocalizedString('commom.elapsed_time')}</span> | |
<span className={styles.label}>{getLocalizedString('common.elapsed_time')}</span> |
<option value='ptbr'>Português Brasil</option> | ||
<option value='es'>Spanish</option> | ||
<option value='sv'>Swedish</option> | ||
<option value='pl'>Polish</option> | ||
<option value='pl'>Polish</option> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Issue Detected: 'ptbr' Language Code Not Fully Integrated
The ptbr
language code is added to the language selection dropdown but is not registered in the application's language configuration or localization files. This may prevent the application from properly handling Brazilian Portuguese language settings.
- Action Required:
- Register
'ptbr'
in the language configuration files. - Add necessary localization entries for
'ptbr'
to support Brazilian Portuguese translations.
- Register
🔗 Analysis chain
LGTM! The changes align with the PR objectives.
The addition of the "Português Brasil" option and the indentation fix for the "Polish" option improve the language selection capabilities and code consistency. These changes successfully implement the PR's goal of adding Brazilian Portuguese language support.
To ensure consistency with the application's language handling system, please verify that the 'ptbr' language code is correctly recognized and implemented throughout the application. Run the following script to check for its usage:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the usage of 'ptbr' language code across the application
# Test: Search for 'ptbr' usage in TypeScript and JavaScript files
echo "Searching for 'ptbr' usage in TypeScript and JavaScript files:"
rg --type-add 'web:*.{ts,tsx,js,jsx}' --type web "'ptbr'" -g '!**/node_modules/**'
# Test: Search for other occurrences of 'Português Brasil' or similar
echo "Searching for other occurrences of 'Português Brasil' or similar:"
rg --type-add 'web:*.{ts,tsx,js,jsx}' --type web "Portugu[eê]s\s*Brasil" -g '!**/node_modules/**'
# Test: Check for language-related configuration files
echo "Checking for language-related configuration files:"
fd -e json -e yaml -e yml -e config "lang|locale|i18n"
Length of output: 930
Script:
#!/bin/bash
# Description: Verify 'ptbr' registration in language configuration and i18n setup
# Test: Search for 'ptbr' in language configuration files
echo "Searching for 'ptbr' in language configuration files:"
rg --type-add 'config:*.{json,yaml,yml}' --type config "'ptbr'" -g '!**/node_modules/**'
# Test: Search for 'ptbr' in localization or translation files
echo "Searching for 'ptbr' in localization or translation files:"
rg --type-add 'local:*.{json,ts}' --type local "'ptbr'" -g '!**/node_modules/**'
Length of output: 441
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (1)
apps/client/src/translation/languages/pt.ts (1)
Line range hint
1-3
: Consider adding a comment to specify the Portuguese dialectThe translations in this file appear to be in Brazilian Portuguese. To avoid any confusion and to help future maintainers, it would be beneficial to add a comment specifying the dialect.
Consider adding a comment at the beginning of the file, like this:
import { TranslationObject } from './en'; +// Brazilian Portuguese translations export const langPt: TranslationObject = {
This will make it clear that these translations are specifically for Brazilian Portuguese, aligning with the PR objectives.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (12)
- apps/client/src/features/operator/status-bar/StatusBarTimers.tsx (3 hunks)
- apps/client/src/translation/languages/de.ts (1 hunks)
- apps/client/src/translation/languages/en.ts (2 hunks)
- apps/client/src/translation/languages/es.ts (1 hunks)
- apps/client/src/translation/languages/fr.ts (1 hunks)
- apps/client/src/translation/languages/hu.ts (1 hunks)
- apps/client/src/translation/languages/it.ts (1 hunks)
- apps/client/src/translation/languages/no.ts (1 hunks)
- apps/client/src/translation/languages/pl.ts (1 hunks)
- apps/client/src/translation/languages/pt-br.ts (1 hunks)
- apps/client/src/translation/languages/pt.ts (1 hunks)
- apps/client/src/translation/languages/sv.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (10)
- apps/client/src/features/operator/status-bar/StatusBarTimers.tsx
- apps/client/src/translation/languages/de.ts
- apps/client/src/translation/languages/en.ts
- apps/client/src/translation/languages/es.ts
- apps/client/src/translation/languages/fr.ts
- apps/client/src/translation/languages/hu.ts
- apps/client/src/translation/languages/it.ts
- apps/client/src/translation/languages/no.ts
- apps/client/src/translation/languages/pl.ts
- apps/client/src/translation/languages/pt-br.ts
🔇 Additional comments (2)
apps/client/src/translation/languages/sv.ts (1)
Line range hint
1-30
: Verify the scope of translation changesWhile this file update improves the Swedish translations, it doesn't align with the PR objectives of adding Brazilian Portuguese translations and incorporating translator codes into the operator's view.
Could you please clarify if there are additional files that implement the Brazilian Portuguese translations and translator codes mentioned in the PR description? If so, ensure they are included in the PR for a comprehensive review.
To verify the presence of Brazilian Portuguese translations, you can run the following script:
apps/client/src/translation/languages/pt.ts (1)
Line range hint
1-31
: Overall, the translations look good with one correction neededThe Portuguese translations in this file are generally well-structured and consistent with Brazilian Portuguese. Once the 'common.elapsed_time' translation is corrected to Portuguese and a comment is added to specify the dialect, this file will be fully aligned with the PR objectives of adding Brazilian Portuguese language support.
@@ -13,6 +13,7 @@ export const langSv: TranslationObject = { | |||
'common.stage_timer': 'Timer för scenen', | |||
'common.started_at': 'Började vid', | |||
'common.time_now': 'Klockan nu', | |||
'common.elapsed_time': 'Elapsed Time', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect translation: 'common.elapsed_time' is not in Swedish
The newly added translation for 'common.elapsed_time' is in English instead of Swedish. This is inconsistent with the rest of the file, which contains Swedish translations.
Please replace the English text with the correct Swedish translation. The Swedish phrase for "Elapsed Time" is "Förfluten tid". Here's the corrected line:
- 'common.elapsed_time': 'Elapsed Time',
+ 'common.elapsed_time': 'Förfluten tid',
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'common.elapsed_time': 'Elapsed Time', | |
'common.elapsed_time': 'Förfluten tid', |
@@ -13,6 +13,7 @@ export const langPt: TranslationObject = { | |||
'common.stage_timer': 'Temporizador do presentador', | |||
'common.started_at': 'Iniciado em', | |||
'common.time_now': 'Hora atual', | |||
'common.elapsed_time': 'Elapsed Time', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translation for 'common.elapsed_time' is in English, not Portuguese
The newly added translation for 'common.elapsed_time' is currently in English ('Elapsed Time') instead of Portuguese. This doesn't align with the purpose of this file, which is to provide Portuguese translations.
Please update the translation to Portuguese. A suggested translation could be:
- 'common.elapsed_time': 'Elapsed Time',
+ 'common.elapsed_time': 'Tempo decorrido',
Make sure to verify this translation with a native Portuguese speaker or a professional translator to ensure accuracy.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'common.elapsed_time': 'Elapsed Time', | |
'common.elapsed_time': 'Tempo decorrido', |
Implementation of variables in the texts on the editor screen so that they use the variables from the translation system. The number of translation variables has been increased. The language is already correct in English and Brazilian Portuguese; for other languages, the variables for each language must be translated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 28
🧹 Outside diff range and nitpick comments (24)
apps/client/src/features/rundown/rundown-header/RundownHeader.tsx (1)
22-22
: LGTM: Button labels correctly internationalizedThe replacement of static button labels with
getLocalizedString
calls is correct and implements the translation feature as intended. This change enhances the user experience for non-English speakers.For consistency, consider extracting the translation keys as constants at the top of the file. This can help with maintenance and reduce the risk of typos. For example:
const TRANSLATION_KEYS = { RUN: 'editor.run', EDIT: 'editor.edit', } as const; // Then use them like this: {getLocalizedString(TRANSLATION_KEYS.RUN)} {getLocalizedString(TRANSLATION_KEYS.EDIT)}Also applies to: 25-25
apps/client/src/features/control/message/MessageControl.tsx (2)
20-25
: LGTM: Localization implemented correctly for TimerMessageInput.The
useTranslation
hook is properly utilized to localize the label and placeholder text. This enhances the component's internationalization capabilities.Consider destructuring
getLocalizedString
directly in the function parameters for consistency with React hooks usage:function TimerMessageInput() { const { text, visible } = useTimerMessageInput(); const { getLocalizedString } = useTranslation(); // ... rest of the function }This approach is more idiomatic in React and can slightly improve readability.
45-50
: LGTM: Localization implemented correctly for ExternalInput.The
useTranslation
hook is properly utilized to localize the label and placeholder text, consistent with the changes inTimerMessageInput
. This further enhances the component's internationalization capabilities.As suggested for
TimerMessageInput
, consider destructuringgetLocalizedString
directly in the function parameters:function ExternalInput() { const { text, visible } = useExternalMessageInput(); const { getLocalizedString } = useTranslation(); // ... rest of the function }This maintains consistency across the component and aligns with idiomatic React practices.
apps/client/src/features/rundown/event-block/EventBlock.utils.ts (2)
Line range hint
25-48
: Localization implemented, but logic change needs attention.The changes successfully implement localization for the gap string. However, there are a few points to consider:
The logic for determining overlap vs. gap has changed. Previously, both cases were handled, but now 'Overlap' is only returned if
timeFromPrevious
is negative, while 'Gap' is always included in the localized string. This might not be the intended behavior.The formatting of the return string has changed. It now includes a dash (-) which wasn't present before. Ensure this is intentional.
Consider using template literals for better readability:
return `${timeFromPrevious < 0 ? 'Overlap ' : ''}${getLocalizedString('editor.gap')} - ${overlapString}`;
- The space after 'Overlap' in the ternary operator might lead to inconsistent spacing. Consider moving it to the localized string if needed.
Please review these changes to ensure they align with the intended functionality.
48-49
: Remove unnecessary empty lines.The extra empty lines at the end of the
formatOverlap
function are not needed. Consider removing them to maintain consistent code style.apps/client/src/features/control/message/TimerViewControl.tsx (2)
34-34
: LGTM: Localized button labels for auxiliary and external timersThe button labels are now correctly using
getLocalizedString
for localization. The keys are descriptive and follow a logical naming convention.Consider extracting these translation keys to a constants file for better maintainability and to avoid potential typos in the future. For example:
// in a constants file export const TRANSLATION_KEYS = { TIMER: { SHOW_AUXTIME: 'timer.show_auxtime', SHOW_EXTERNAL: 'timer.show_external', // ... other keys }, // ... other categories }; // in this file import { TRANSLATION_KEYS } from './path/to/constants'; // ... {getLocalizedString(TRANSLATION_KEYS.TIMER.SHOW_AUXTIME)}This approach can help centralize all translation keys and make it easier to manage them as the application grows.
Also applies to: 41-41
Line range hint
1-65
: Overall assessment: Successful implementation of localizationThe changes in this file successfully implement localization for all button labels in the
TimerControlsPreview
component. The modifications are consistent and align well with the PR objective of adding translation support.To further improve the code:
- Consider implementing the suggestion to extract translation keys to a constants file for better maintainability.
- If not already done, ensure that the Brazilian Portuguese translations for these keys are added to the translation files.
- Consider adding unit tests to verify that the correct localized strings are being used for each button label.
Great job on implementing the localization feature!
apps/client/src/features/rundown/event-editor/composite/EventEditorTitles.tsx (1)
30-32
: LGTM: useTranslation hook added correctly. Consider removing empty line.The
useTranslation
hook is correctly used, andgetLocalizedString
is appropriately destructured. However, the empty line at 32 can be removed for better code organization.Consider applying this change:
const { getLocalizedString } = useTranslation(); - return (
apps/client/src/features/rundown/rundown-header/RundownMenu.tsx (1)
Line range hint
1-71
: Overall, excellent implementation of localization in RundownMenu component.The changes successfully implement localization throughout the RundownMenu component, replacing all hardcoded strings with localized versions. This aligns well with the PR objective of adding Brazilian Portuguese language support and enhances the component's internationalization capabilities.
Key improvements:
- Proper import and usage of the
useTranslation
hook.- Consistent use of
getLocalizedString
for all user-facing text.- Appropriate key naming conventions (e.g., 'editor.clear', 'global.cancel').
These changes will greatly improve the accessibility of the application for Portuguese-speaking users and set a good foundation for future language additions.
Consider creating a centralized file for translation keys to maintain consistency and ease future updates across the application.
apps/client/src/translation/languages/en.ts (4)
18-29
: LGTM: Timer-related translations added with minor suggestionThe new 'timer' prefixed translations have been added successfully. They provide clear meanings for timer-related UI elements and include helpful placeholders for context.
For consistency, consider capitalizing 'blink' in the 'timer.blink' translation:
- 'timer.blink': 'blink', + 'timer.blink': 'Blink',
30-45
: LGTM: Editor-related translations added with minor suggestionsThe new 'editor' prefixed translations have been added successfully, providing clear meanings for various editor-related UI elements.
Consider the following minor improvements for consistency:
- Add a space after the colon for 'editor.event' and 'editor.delay':
- 'editor.event':'Event', - 'editor.delay':'Delay', + 'editor.event': 'Event', + 'editor.delay': 'Delay',
- Consider using sentence case for 'editor.upnext' to maintain consistency with other translations:
- 'editor.upnext': 'UP NEXT', + 'editor.upnext': 'Up Next',
50-63
: LGTM: Global translations and alert message added successfullyThe new 'global' prefixed translations and the alert message for clearing the rundown have been added correctly. They provide clear and concise translations for various UI elements and actions.
Consider removing the extra space in 'global.delete':
- 'global.delete': 'Delete', + 'global.delete': 'Delete',
74-75
: Remove unnecessary empty linesConsider removing the two empty lines at the end of the file to maintain a clean and consistent code style.
'timeline.due': 'due', 'timeline.followedby': 'Followed by', - - };apps/client/src/features/control/playback/aux-timer/AuxTimer.tsx (2)
18-18
: LGTM: Implementation of localized stringThe
useTranslation
hook is correctly used to obtain thegetLocalizedString
function, which is then applied to replace the static "Auxiliary Timer" label. This change effectively implements internationalization for this component.Consider extracting the translation key 'common.aux_time' into a constant at the top of the file or in a separate constants file. This can improve maintainability and reduce the risk of typos when reusing the key. For example:
const TRANSLATION_KEYS = { AUX_TIME: 'common.aux_time', } as const; // Then use it like this: {getLocalizedString(TRANSLATION_KEYS.AUX_TIME)}Also applies to: 34-34
Line range hint
76-76
: Consider internationalizing the placeholder textWhile the main label has been internationalized, the placeholder text in the AuxTimerInput component is still hardcoded. For consistency, consider internationalizing this text as well.
You could modify the AuxTimerInput component like this:
function AuxTimerInput() { const time = useAuxTimerTime(); const { setDuration } = setAuxTimer; const { getLocalizedString } = useTranslation(); // ... rest of the component ... return ( <TimeInput<'auxTimer'> submitHandler={handleTimeUpdate} name='auxTimer' time={time} placeholder={getLocalizedString('common.aux_timer_placeholder')} /> ); }Don't forget to add the new translation key to your translation files.
apps/client/src/translation/languages/hu.ts (1)
Line range hint
1-65
: Complete Hungarian translations for newly added termsThank you for expanding the Hungarian language support in this file. The structure and keys appear to be correct, and the previously mentioned typo in the 'common.elapsed_time' key has been fixed. However, the main issue is that all newly added translations are still in English.
To complete this task:
- Translate all newly added terms from English to Hungarian.
- Ensure that the translations accurately convey the meaning of each term in the context of the user interface.
- Pay special attention to technical terms and UI-specific language to maintain clarity and consistency with the application's functionality.
- Consider consulting with a native Hungarian speaker or professional translator to verify the accuracy and naturalness of the translations.
Once the translations are complete, this file will significantly enhance the Hungarian language support for the application.
If you need any assistance in organizing or managing the translation process, please let me know, and I'd be happy to help.
apps/client/src/translation/languages/pt.ts (1)
Line range hint
1-65
: Ensure all entries are translated to PortugueseThank you for adding new entries to the Portuguese translation file. However, it's crucial to ensure that all entries are actually translated to Portuguese, not just added in English. This applies to all the new entries added in this pull request.
Here are some general guidelines for maintaining this translation file:
- Translate all text values to Portuguese, keeping the keys in English.
- Pay attention to context and technical terms to ensure accurate translations.
- Maintain consistency in formatting and capitalization across similar entries.
- Consider cultural nuances and localization best practices for Brazilian Portuguese.
After implementing the suggested translations, please have a native Portuguese speaker or a professional translator review the changes to ensure accuracy and natural phrasing.
apps/client/src/features/control/playback/playback-timer/PlaybackTimer.tsx (2)
76-76
: LGTM: Localization applied correctly to JSX elements.The hardcoded strings have been appropriately replaced with calls to
getLocalizedString
, using logical key names. This change successfully implements localization for these UI elements.For consistency, consider updating the "Roll: Countdown to start" string on line 73 to use localization as well:
- <span className={style.rolltag}>Roll: Countdown to start</span> + <span className={style.rolltag}>{getLocalizedString('common.roll_countdown')}</span>Also applies to: 80-80
Line range hint
1-89
: Summary: Localization successfully implemented in PlaybackTimer component.The changes in this file effectively implement localization for the PlaybackTimer component. The addition of the
useTranslation
hook and the replacement of hardcoded strings withgetLocalizedString
function calls are well-executed and consistent. These modifications align with the PR objectives of adding Brazilian Portuguese language support and enhancing the system's multilingual capabilities.The changes maintain the original functionality while improving the component's adaptability to different languages. This update will contribute to a better user experience for Portuguese-speaking users and potentially other language users in the future.
As the project continues to expand its multilingual support, consider implementing a centralized string management system (e.g., using JSON files for each supported language) to ease the maintenance and addition of new languages in the future.
apps/client/src/features/rundown/quick-add-block/QuickAddBlock.tsx (1)
81-81
: LGTM: Button labels internationalized correctly.The hardcoded button labels have been appropriately replaced with calls to
getLocalizedString
, enabling dynamic translation based on the user's language preferences. This change aligns well with the PR objective of adding translation support.For consistency, consider extracting these translation keys as constants at the top of the file or in a separate constants file. This would make it easier to maintain and update the keys in the future. For example:
const TRANSLATION_KEYS = { EVENT: 'editor.event', DELAY: 'editor.delay', BLOCK: 'editor.block', }; // Then use them like this: {getLocalizedString(TRANSLATION_KEYS.EVENT)}Also applies to: 91-91, 101-101
apps/client/src/features/rundown/event-editor/EventEditor.tsx (1)
108-110
: LGTM: Strings internationalized correctly.The hardcoded strings have been properly replaced with calls to
getLocalizedString
, which is the correct approach for internationalization. The keys used are appropriate and seem to follow a global naming convention.For consistency, consider wrapping the
getLocalizedString('global.manage')
call in curly braces, like this:<Button variant='ontime-subtle' size='sm' onClick={handleOpenCustomManager}> {getLocalizedString('global.manage')} </Button>This makes it clearer that it's a JavaScript expression and maintains consistency with other JSX usage in the file.
apps/client/src/features/rundown/event-block/EventBlockInner.tsx (1)
Line range hint
84-102
: LGTM: Localization implemented for "UP NEXT" tagThe "UP NEXT" text is now correctly localized using the
getLocalizedString
function from the translation hook. This improves the component's internationalization capabilities.Consider adding a comment explaining the purpose of the 'editor.upnext' key for better maintainability:
- {isNext && <span className={style.nextTag}>{getLocalizedString('editor.upnext')} </span>} + {isNext && <span className={style.nextTag}>{getLocalizedString('editor.upnext')} {/* Localized "UP NEXT" text */}</span>}apps/client/src/features/overview/Overview.tsx (2)
27-27
: LGTM: Localization implemented in _EditorOverviewThe implementation of localization using
getLocalizedString
is consistent and aligns with the PR objectives. Good job on using descriptive keys for the translations.For improved consistency, consider extracting the
getLocalizedString
call to a constant at the beginning of the component, similar to how you've handled other derived values. This could make the JSX more readable:const scheduledStartLabel = getLocalizedString('common.scheduled_start'); const startedAtLabel = getLocalizedString('common.started_at'); // ... other labels ... // Then in JSX: <TimeRow label={scheduledStartLabel} value={formatedTime(plannedStart)} className={style.start} />This is a minor suggestion and the current implementation is perfectly acceptable.
Also applies to: 36-37, 43-45
Line range hint
1-144
: Overall: Excellent implementation of localizationGreat job on implementing localization across all components in this file. The changes are consistent, follow good practices, and align well with the PR objectives of adding Brazilian Portuguese language support.
A minor optimization to consider:
SincegetLocalizedString
is used in multiple components, you might want to create a custom hook that combinesuseTranslation
with memoization of frequently used strings. This could potentially improve performance and reduce redundant code. For example:function useLocalizedStrings() { const { getLocalizedString } = useTranslation(); return useMemo(() => ({ scheduledStart: getLocalizedString('common.scheduled_start'), startedAt: getLocalizedString('common.started_at'), // ... other frequently used strings }), [getLocalizedString]); }Then in your components, you could use:
const strings = useLocalizedStrings(); // ... <TimeRow label={strings.scheduledStart} value={formatedTime(plannedStart)} className={style.start} />This is just a suggestion for potential future optimization and is not necessary for the current implementation, which is already well done.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (24)
- apps/client/src/features/control/message/MessageControl.tsx (3 hunks)
- apps/client/src/features/control/message/TimerViewControl.tsx (5 hunks)
- apps/client/src/features/control/playback/aux-timer/AuxTimer.tsx (2 hunks)
- apps/client/src/features/control/playback/playback-timer/PlaybackTimer.tsx (3 hunks)
- apps/client/src/features/overview/Overview.tsx (7 hunks)
- apps/client/src/features/rundown/event-block/EventBlock.utils.ts (3 hunks)
- apps/client/src/features/rundown/event-block/EventBlockInner.tsx (3 hunks)
- apps/client/src/features/rundown/event-editor/EventEditor.tsx (3 hunks)
- apps/client/src/features/rundown/event-editor/composite/EventEditorTimes.tsx (3 hunks)
- apps/client/src/features/rundown/event-editor/composite/EventEditorTitles.tsx (3 hunks)
- apps/client/src/features/rundown/quick-add-block/QuickAddBlock.tsx (5 hunks)
- apps/client/src/features/rundown/rundown-header/RundownHeader.tsx (1 hunks)
- apps/client/src/features/rundown/rundown-header/RundownMenu.tsx (3 hunks)
- apps/client/src/translation/languages/de.ts (1 hunks)
- apps/client/src/translation/languages/en.ts (2 hunks)
- apps/client/src/translation/languages/es.ts (1 hunks)
- apps/client/src/translation/languages/fr.ts (1 hunks)
- apps/client/src/translation/languages/hu.ts (1 hunks)
- apps/client/src/translation/languages/it.ts (1 hunks)
- apps/client/src/translation/languages/no.ts (1 hunks)
- apps/client/src/translation/languages/pl.ts (1 hunks)
- apps/client/src/translation/languages/pt-br.ts (1 hunks)
- apps/client/src/translation/languages/pt.ts (1 hunks)
- apps/client/src/translation/languages/sv.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- apps/client/src/translation/languages/pt-br.ts
🔇 Additional comments (51)
apps/client/src/features/rundown/rundown-header/RundownHeader.tsx (2)
9-10
: LGTM: Proper implementation of translation hookThe addition of the
useTranslation
import and its usage within the component is correct and aligns with the PR objective of adding translation support. This change enhances the internationalization capabilities of theRundownHeader
component.Also applies to: 16-16
9-10
: Summary: Successful implementation of internationalizationThe changes in this file successfully implement internationalization for the RundownHeader component. The addition of the
useTranslation
hook and the replacement of static strings withgetLocalizedString
calls are well-executed and align perfectly with the PR objective of adding translation support.These modifications enhance the component's ability to display text in different languages, improving the application's accessibility for non-English speaking users, particularly those who speak Brazilian Portuguese as mentioned in the PR description.
The changes are minimal, targeted, and do not introduce any potential issues or bugs. They follow React best practices and maintain the existing functionality while adding the new translation feature.
Also applies to: 16-16, 22-22, 25-25
apps/client/src/features/control/message/MessageControl.tsx (2)
6-7
: LGTM: Translation hook import added correctly.The
useTranslation
hook is imported from the correct local module, which is a good practice for implementing localization.
Line range hint
1-56
: Overall: Excellent implementation of localization support.The changes effectively introduce localization to the
MessageControl
component. TheuseTranslation
hook is consistently used across bothTimerMessageInput
andExternalInput
functions, replacing hardcoded strings with localized versions. This significantly enhances the internationalization capabilities of the component.A few minor suggestions were made for improving code consistency and readability, but these are not critical. The implementation is solid and achieves the goal of adding Brazilian Portuguese language support as mentioned in the PR objectives.
apps/client/src/features/rundown/event-block/EventBlock.utils.ts (2)
11-11
: LGTM: Import statement for translation function added.The import statement for
useTranslation
is correctly placed and necessary for the localization changes in theformatOverlap
function.
Line range hint
1-49
: Summary: Localization implemented, but further review needed.The changes successfully introduce localization to the
formatOverlap
function, which aligns with the PR objectives of adding Brazilian Portuguese language support. However, there are a few areas that require attention:
- The logic for determining overlap vs. gap has changed, which may affect the function's behavior.
- The formatting of the return string has been modified, including the addition of a dash.
- There are minor code style issues, such as unnecessary empty lines.
To ensure these changes don't introduce unintended side effects, please run the following verification:
This script will help identify areas of the codebase that might be affected by the changes to
formatOverlap
. Please review the results to ensure that the modifications align with the expected behavior across the application.✅ Verification successful
Follow-Up Verification Scripts
Please run the following updated verification script to gather the necessary information:
Verification Successful: No issues found
The localization enhancements to the
formatOverlap
function are correctly implemented and thoroughly tested. The'editor.gap'
translation key is consistently used across all relevant files, and the test coverage ensures the function behaves as expected in various scenarios.
formatOverlap
is utilized inRundownIndicators.tsx
and adequately covered by tests in__tests__/EventBlock.utils.test.ts
.- The
'editor.gap'
key is properly localized in all supported language files.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for usage of formatOverlap function and potential impacts # Search for usage of formatOverlap function echo "Searching for usage of formatOverlap function:" rg --type typescript "formatOverlap\(" -A 5 # Search for tests related to formatOverlap echo "Searching for tests related to formatOverlap:" rg --type typescript "test.*formatOverlap" -A 10 # Search for other occurrences of 'editor.gap' translation key echo "Searching for other occurrences of 'editor.gap' translation key:" rg --type typescript "('|\")editor\.gap('|\")"Length of output: 603
Script:
#!/bin/bash # Description: Check for usage of formatOverlap function and potential impacts # Search for usage of formatOverlap function echo "Searching for usage of formatOverlap function:" rg "formatOverlap\(" --glob "*.ts" --glob "*.tsx" -A 5 # Search for tests related to formatOverlap echo "Searching for tests related to formatOverlap:" rg "test.*formatOverlap" --glob "*.ts" --glob "*.tsx" -A 10 # Search for other occurrences of 'editor.gap' translation key echo "Searching for other occurrences of 'editor.gap' translation key:" rg "('|\")editor\.gap('|\")" --glob "*.ts" --glob "*.tsx"Length of output: 8945
apps/client/src/features/control/message/TimerViewControl.tsx (3)
9-10
: LGTM: Import statement for useTranslationThe import statement for
useTranslation
is correctly placed and aligns with the PR objective of adding translation support.
22-23
: LGTM: Proper usage of useTranslation hookThe
useTranslation
hook is correctly used, and destructuringgetLocalizedString
is a good practice. This setup enables the localization of button labels as intended.
52-52
: LGTM: Localized button labels for blink and blackout functionsThe button labels for blink and blackout functions are now correctly using
getLocalizedString
for localization. The keys are concise and follow the same naming convention as the previous set.The suggestion from the previous comment about extracting translation keys to a constants file applies here as well.
Also applies to: 61-61
apps/client/src/features/rundown/event-editor/composite/EventEditorTitles.tsx (6)
12-12
: LGTM: Import statement for useTranslation added correctly.The import statement for
useTranslation
is correctly placed and necessary for the localization changes in the component.
38-38
: LGTM: eventId label correctly localized.The eventId label has been properly localized using the
getLocalizedString
function with an appropriate key.
49-49
: LGTM: Cue label in EventTextInput correctly localized.The label for the cue input has been properly localized using the
getLocalizedString
function with the 'global.cue' key, which seems appropriate for potential reuse across the application.
52-52
: LGTM: Colour label correctly localized.The colour label has been properly localized using the
getLocalizedString
function with the 'global.colour' key, maintaining consistency with other global string keys.
55-56
: LGTM: Title and Note labels correctly localized in EventTextInput and EventTextArea.The labels for the title and note inputs have been properly localized using the
getLocalizedString
function with appropriate keys ('global.title' and 'global.note'). This maintains consistency with other global string keys and correctly implements localization for these fields.
Line range hint
1-62
: Overall: Excellent implementation of localization in EventEditorTitles component.The changes in this file successfully implement localization for the EventEditorTitles component. All hardcoded strings have been replaced with localized versions using the
getLocalizedString
function from theuseTranslation
hook. This implementation aligns well with the PR objectives of adding Brazilian Portuguese language support and enhances the component's internationalization capabilities.Key points:
- Consistent use of
getLocalizedString
for all labels.- Appropriate key naming convention (e.g., 'global.title', 'editor.eventid').
- Existing functionality and structure of the component are preserved.
These changes will significantly improve the accessibility of the application for Portuguese-speaking users while maintaining a flexible structure for potential future language additions.
apps/client/src/features/rundown/rundown-header/RundownMenu.tsx (4)
18-19
: LGTM: Import statement for useTranslation is correctly added.The import statement for
useTranslation
is properly placed and correctly references theTranslationProvider
. This addition enables the use of localization features in the component.
34-35
: LGTM: useTranslation hook is correctly implemented.The
useTranslation
hook is properly used to extract thegetLocalizedString
function. This setup allows for efficient access to localized strings throughout the component.
46-46
: LGTM: "Clear rundown" button text is properly localized.The hardcoded "Clear rundown" text has been correctly replaced with a localized version using
getLocalizedString('editor.clear')
. This change enhances the component's internationalization capabilities.
59-62
: LGTM: AlertDialog buttons are properly localized.The "Cancel" and "Delete all" button texts have been correctly replaced with localized versions using appropriate global keys. This change contributes to the overall internationalization of the component and maintains consistency across the application.
apps/client/src/translation/languages/en.ts (2)
14-17
: LGTM: New 'common' translations added successfullyThe new 'common' prefixed translations have been added correctly. They are consistent with the existing style and provide clear, concise translations for important UI elements.
46-49
: LGTM: End action translations added successfullyThe new 'endaction' prefixed translations have been added correctly. They provide clear and concise translations for various end action options.
apps/client/src/features/control/playback/aux-timer/AuxTimer.tsx (1)
14-14
: LGTM: Import statement for internationalizationThe import statement for
useTranslation
is correctly added and aligns with the existing import style. This import is necessary for implementing the internationalization changes.apps/client/src/translation/languages/sv.ts (1)
16-19
:⚠️ Potential issueTranslations need to be in Swedish
The newly added 'common' translations are in English instead of Swedish. This is inconsistent with the rest of the file, which contains Swedish translations. Please provide the correct Swedish translations for these terms:
- 'common.elapsed_time' should be 'Förfluten tid' (as mentioned in the previous review)
- 'common.progress' should be 'Framsteg'
- 'common.offset' should be 'Förskjutning'
- 'common.aux_time' should be 'Hjälptimer'
apps/client/src/translation/languages/pt.ts (1)
16-19
:⚠️ Potential issueConvert 'common' translations to Portuguese
The newly added 'common' translations are currently in English. To align with the purpose of this file, please translate these to Portuguese:
- 'common.elapsed_time': 'Elapsed Time', - 'common.progress': 'Progress', - 'common.offset': 'Offset', - 'common.aux_time': 'Auxiliary Timer', + 'common.elapsed_time': 'Tempo decorrido', + 'common.progress': 'Progresso', + 'common.offset': 'Deslocamento', + 'common.aux_time': 'Temporizador auxiliar',Please verify these translations with a native Portuguese speaker or a professional translator to ensure accuracy.
apps/client/src/features/control/playback/playback-timer/PlaybackTimer.tsx (2)
11-11
: LGTM: Import statement for localization added correctly.The import statement for
useTranslation
is correctly added and is necessary for the localization changes implemented in the component.
56-56
: LGTM: Translation hook used correctly.The
useTranslation
hook is properly utilized to extract thegetLocalizedString
function, which will be used for localizing strings in the component.apps/client/src/translation/languages/de.ts (1)
16-16
:⚠️ Potential issueFix typo and provide German translation for 'elapsed time'
This entry was mentioned in a previous review comment. The issues still persist:
- There's a typo in the key: 'commom' should be 'common'.
- The translation is in English, not German.
Please apply the following change:
- 'common.elapsed_time': 'Elapsed Time', + 'common.elapsed_time': 'Verstrichene Zeit',Likely invalid or redundant comment.
apps/client/src/features/rundown/quick-add-block/QuickAddBlock.tsx (3)
10-10
: LGTM: Import statement for internationalization added correctly.The import of
useTranslation
from the TranslationProvider is correctly placed and necessary for the internationalization changes in this component.
27-27
: LGTM: Translation hook implemented correctly.The
useTranslation
hook is properly utilized to extract thegetLocalizedString
function. This change aligns well with the PR objective of adding translation support to the component.
Line range hint
1-104
: Summary: Internationalization successfully implemented.The changes in this file successfully implement internationalization support for the QuickAddBlock component. The modifications include:
- Importing the necessary translation hook.
- Using the
getLocalizedString
function to replace hardcoded button labels.These changes align well with the PR objective of adding Brazilian Portuguese language support to the translation system. The implementation is consistent and correct, with only a minor suggestion for improvement regarding the organization of translation keys.
Great job on enhancing the multilingual capabilities of the system!
apps/client/src/features/rundown/event-editor/EventEditor.tsx (3)
19-19
: LGTM: Import statement for translation hook added correctly.The import statement for
useTranslation
from theTranslationProvider
has been added correctly. This is a necessary step for implementing internationalization in the component.
76-76
: LGTM: Translation hook used correctly.The
useTranslation
hook is properly utilized to obtain thegetLocalizedString
function. This setup allows for easy integration of translated strings within the component.
Line range hint
1-138
: Summary: Successful implementation of internationalization.The changes made to this file successfully implement internationalization for the
EventEditor
component. TheuseTranslation
hook is properly imported and utilized, and hardcoded strings have been replaced with localized versions. These modifications align well with the PR objectives of adding Brazilian Portuguese language support.The implementation follows React best practices and doesn't introduce any apparent issues or bugs. This update enhances the component's multilingual capabilities, improving accessibility for users of different languages, including Portuguese speakers.
apps/client/src/features/rundown/event-editor/composite/EventEditorTimes.tsx (9)
12-12
: LGTM: Import statement for useTranslationThe import statement for
useTranslation
is correctly added and is consistent with the file's import style. This import is necessary for the internationalization changes implemented in the component.
74-75
: LGTM: Proper use of useTranslation hookThe
useTranslation
hook is correctly used to obtain thegetLocalizedString
function. This is placed appropriately at the beginning of the component, following React hooks best practices.
79-79
: LGTM: Internationalization of "Event schedule" labelThe "Event schedule" label is correctly updated to use
getLocalizedString
, supporting internationalization. The translation key 'editor.event_schedule' appears appropriate and consistent with naming conventions.
97-97
: LGTM: Internationalization of "Warning Time" labelThe "Warning Time" label is correctly updated to use
getLocalizedString
, supporting internationalization. The translation key 'editor.warning_time' is appropriate and consistent with the naming convention used.
102-102
: LGTM: Internationalization of "Timer Type" label and optionsThe "Timer Type" label and its select options are correctly updated to use
getLocalizedString
, supporting internationalization. The translation keys (e.g., 'editor.timer_type', 'timer.countdown', etc.) are appropriate and follow a consistent naming convention.Also applies to: 110-113
118-118
: LGTM: Internationalization of "Danger Time" labelThe "Danger Time" label is correctly updated to use
getLocalizedString
, supporting internationalization. The translation key 'editor.danger_time' is appropriate and consistent with the naming convention used.
123-123
: LGTM: Internationalization of "End Action" label and optionsThe "End Action" label and its select options are correctly updated to use
getLocalizedString
, supporting internationalization. The translation keys (e.g., 'editor.end_action', 'endaction.none', etc.) are appropriate and follow a consistent naming convention.Also applies to: 131-134
140-140
: LGTM: Internationalization of "Event Visibility" labelThe "Event Visibility" label is correctly updated to use
getLocalizedString
, supporting internationalization. The translation key 'editor.event_visibility' is appropriate and consistent with the naming convention used.
Line range hint
1-153
: Overall assessment: Successful internationalization implementationThe changes in this file effectively implement internationalization support for the
EventEditorTimes
component. Most UI elements now usegetLocalizedString
for text rendering, which allows for easy translation to different languages. The translation keys used are consistent and follow a logical naming convention (e.g., 'editor.', 'timer.', 'endaction.' prefixes).The component's core functionality remains unchanged, ensuring that these updates only affect the text display and not the underlying logic. This approach to internationalization is clean and maintainable.
One minor improvement was suggested for the visibility switch label to ensure complete coverage of internationalization.
Great job on improving the accessibility and global reach of the application!
apps/client/src/features/rundown/event-block/EventBlockInner.tsx (2)
23-23
: LGTM: Translation hook import added correctlyThe import of
useTranslation
from the TranslationProvider is correctly placed and necessary for the localization changes in this component.
Line range hint
53-59
: LGTM: Default values added to propsAdding default values for
isPublic
andskip
props improves the component's robustness. These changes align with the updatedEventBlockInnerProps
interface mentioned in the summary.apps/client/src/features/overview/Overview.tsx (6)
11-11
: LGTM: Import statement for useTranslationThe import statement for
useTranslation
is correctly placed and consistent with the PR objectives of adding translation support.
67-67
: LGTM: Localization implemented in _CuesheetOverviewThe implementation of localization in _CuesheetOverview is consistent with the changes in _EditorOverview and aligns with the PR objectives. The reuse of translation keys across components is a good practice for maintaining consistency in the UI.
Also applies to: 78-80
107-109
: LGTM: Localization implemented in CurrentBlockOverviewThe implementation of localization in CurrentBlockOverview is consistent with previous changes and aligns with the PR objectives. The translation key 'common.elapsed_time' is descriptive and follows the established pattern.
116-118
: LGTM: Localization implemented in TimerOverviewThe implementation of localization in TimerOverview is consistent with previous changes and aligns with the PR objectives.
I noticed that the translation key 'countdown.running' follows a slightly different pattern compared to the 'common.*' keys used elsewhere. Is this intentional? If so, it might be helpful to add a comment explaining the different categorization for future maintainers.
Could you clarify the reasoning behind using 'countdown.running' instead of 'common.running' or a similar key?
127-129
: LGTM: Localization implemented in ProgressOverviewThe implementation of localization in ProgressOverview is consistent with previous changes and aligns with the PR objectives. The translation key 'common.progress' follows the established pattern.
137-142
: LGTM: Localization implemented in RuntimeOverviewThe implementation of localization in RuntimeOverview is consistent with previous changes and aligns with the PR objectives. The translation keys 'common.offset' and 'common.time_now' follow the established pattern.
apps/client/src/translation/languages/it.ts (1)
16-65
: Translations need to be in ItalianThe new translation entries from lines 16 to 65 have English values. Since this is the Italian translation file, please provide the correct Italian translations for these keys to maintain consistency and proper localization.
'{getLocalizedString('editor.clear')}' | ||
</AlertDialogHeader> | ||
<AlertDialogBody> | ||
You will lose all data in your rundown. <br /> Are you sure? | ||
{getLocalizedString('alert.clear_rundown')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AlertDialog content is localized, but remove extra quotes in header.
The AlertDialog content has been properly localized, enhancing the component's internationalization. However, there's an issue in the AlertDialogHeader:
Remove the extra single quotes around the localized string in the AlertDialogHeader. Apply this change:
- '{getLocalizedString('editor.clear')}'
+ {getLocalizedString('editor.clear')}
This will ensure the localized string is rendered correctly without additional quotes.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'{getLocalizedString('editor.clear')}' | |
</AlertDialogHeader> | |
<AlertDialogBody> | |
You will lose all data in your rundown. <br /> Are you sure? | |
{getLocalizedString('alert.clear_rundown')} | |
{getLocalizedString('editor.clear')} | |
</AlertDialogHeader> | |
<AlertDialogBody> | |
{getLocalizedString('alert.clear_rundown')} |
'global.colour': 'Colour', | ||
'global.custom_fields': 'Custom Fields', | ||
'global.manage': 'Manage', | ||
'alert.clear_rundown': 'You will lose all data in your rundown. Are you sure?', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translate alert message to Norwegian
The new alert message is in English instead of Norwegian. To maintain consistency and provide a fully localized experience, this should be translated.
Please translate the alert message to Norwegian. For example:
- 'alert.clear_rundown': 'You will lose all data in your rundown. Are you sure?',
+ 'alert.clear_rundown': 'Du vil miste alle data i kjøreplanen din. Er du sikker?',
Ensure the translation accurately conveys the meaning of the original message in Norwegian.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'alert.clear_rundown': 'You will lose all data in your rundown. Are you sure?', | |
'alert.clear_rundown': 'Du vil miste alle data i kjøreplanen din. Er du sikker?', |
'common.elapsed_time': 'Elapsed Time', | ||
'common.progress': 'Progress', | ||
'common.offset': 'Offset', | ||
'common.aux_time': 'Auxiliary Timer', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translate new entries to Norwegian
The new entries for common terms are currently in English. As this is the Norwegian language file, these should be translated to Norwegian to maintain consistency and fulfill the file's purpose.
Please translate the following entries to Norwegian:
- 'common.elapsed_time'
- 'common.progress'
- 'common.offset'
- 'common.aux_time'
For example:
- 'common.elapsed_time': 'Elapsed Time',
+ 'common.elapsed_time': 'Forløpt tid',
Committable suggestion was skipped due to low confidence.
'timer.message': 'Timer Message', | ||
'timer.message.plac': 'Message show fullscreen stage timer', | ||
'timer.external': 'External Message', | ||
'timer.external.plac': 'Message show as secondary text in stage timer', | ||
'timer.show_auxtime': 'Show Aux Timer', | ||
'timer.show_external': 'Show External', | ||
'timer.blink': 'blink', | ||
'timer.blackout': 'Blackout Screen', | ||
'timer.countdown': 'Countdown', | ||
'timer.countup': 'Count Up', | ||
'timer.timetoend': 'Time to End', | ||
'timer.clock': 'Clock', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translate timer-related entries to Norwegian
The new timer-related entries are currently in English. These should be translated to Norwegian to ensure consistency within the language file and proper localization.
Please translate all timer-related entries to Norwegian. For example:
- 'timer.message': 'Timer Message',
+ 'timer.message': 'Timermelding',
- 'timer.external': 'External Message',
+ 'timer.external': 'Ekstern melding',
Ensure all entries from 'timer.message' to 'timer.clock' are properly translated.
Committable suggestion was skipped due to low confidence.
'editor.run': 'Run', | ||
'editor.edit': 'Edit', | ||
'editor.event':'Event', | ||
'editor.delay':'Delay', | ||
'editor.block':'Block', | ||
'editor.gap': 'Gap', | ||
'editor.nextday': 'Next Day', | ||
'editor.clear':'Clear Rundown', | ||
'editor.event_schedule': 'Event Schedule', | ||
'editor.warning_time': 'Warning Time', | ||
'editor.danger_time': 'Danger Time', | ||
'editor.event_visibility': 'Event Visibility', | ||
'editor.timer_type': 'Timer Type', | ||
'editor.end_action': 'End Action', | ||
'editor.eventid': 'Event ID (Read Only)', | ||
'editor.upnext': 'UP NEXT', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translate editor-related entries to Norwegian
The new editor-related entries are in English instead of Norwegian. To maintain the integrity of the Norwegian language file, these should be translated.
Please translate all editor-related entries to Norwegian. For example:
- 'editor.run': 'Run',
+ 'editor.run': 'Kjør',
- 'editor.edit': 'Edit',
+ 'editor.edit': 'Rediger',
Ensure all entries from 'editor.run' to 'editor.upnext' are properly translated to Norwegian.
Committable suggestion was skipped due to low confidence.
'global.save': 'Save', | ||
'global.delete': 'Delete', | ||
'global.delete_all': 'Delete All', | ||
'global.exit': 'Exit', | ||
'global.cancel': 'Cancel', | ||
'global.public': 'Public', | ||
'global.private': 'Private', | ||
'global.cue': 'Cue', | ||
'global.title': 'Title', | ||
'global.note': 'Note', | ||
'global.colour': 'Colour', | ||
'global.custom_fields': 'Custom Fields', | ||
'global.manage': 'Manage', | ||
'alert.clear_rundown': 'You will lose all data in your rundown. Are you sure?', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translate 'global' and 'alert' related entries to Portuguese
The 'global' and 'alert' related entries are currently in English. Please translate them to Portuguese, considering the UI context:
- 'global.save': 'Save',
- 'global.delete': 'Delete',
- 'global.delete_all': 'Delete All',
- 'global.exit': 'Exit',
- 'global.cancel': 'Cancel',
- 'global.public': 'Public',
- 'global.private': 'Private',
- 'global.cue': 'Cue',
- 'global.title': 'Title',
- 'global.note': 'Note',
- 'global.colour': 'Colour',
- 'global.custom_fields': 'Custom Fields',
- 'global.manage': 'Manage',
- 'alert.clear_rundown': 'You will lose all data in your rundown. Are you sure?',
+ 'global.save': 'Salvar',
+ 'global.delete': 'Excluir',
+ 'global.delete_all': 'Excluir tudo',
+ 'global.exit': 'Sair',
+ 'global.cancel': 'Cancelar',
+ 'global.public': 'Público',
+ 'global.private': 'Privado',
+ 'global.cue': 'Deixa',
+ 'global.title': 'Título',
+ 'global.note': 'Nota',
+ 'global.colour': 'Cor',
+ 'global.custom_fields': 'Campos personalizados',
+ 'global.manage': 'Gerenciar',
+ 'alert.clear_rundown': 'Você perderá todos os dados do seu roteiro. Tem certeza?',
Please verify these translations with a native Portuguese speaker or a professional translator to ensure accuracy and natural phrasing in the context of user interface elements.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'global.save': 'Save', | |
'global.delete': 'Delete', | |
'global.delete_all': 'Delete All', | |
'global.exit': 'Exit', | |
'global.cancel': 'Cancel', | |
'global.public': 'Public', | |
'global.private': 'Private', | |
'global.cue': 'Cue', | |
'global.title': 'Title', | |
'global.note': 'Note', | |
'global.colour': 'Colour', | |
'global.custom_fields': 'Custom Fields', | |
'global.manage': 'Manage', | |
'alert.clear_rundown': 'You will lose all data in your rundown. Are you sure?', | |
'global.save': 'Salvar', | |
'global.delete': 'Excluir', | |
'global.delete_all': 'Excluir tudo', | |
'global.exit': 'Sair', | |
'global.cancel': 'Cancelar', | |
'global.public': 'Público', | |
'global.private': 'Privado', | |
'global.cue': 'Deixa', | |
'global.title': 'Título', | |
'global.note': 'Nota', | |
'global.colour': 'Cor', | |
'global.custom_fields': 'Campos personalizados', | |
'global.manage': 'Gerenciar', | |
'alert.clear_rundown': 'Você perderá todos os dados do seu roteiro. Tem certeza?', |
'editor.run': 'Run', | ||
'editor.edit': 'Edit', | ||
'editor.event':'Event', | ||
'editor.delay':'Delay', | ||
'editor.block':'Block', | ||
'editor.gap': 'Gap', | ||
'editor.nextday': 'Next Day', | ||
'editor.clear':'Clear Rundown', | ||
'editor.event_schedule': 'Event Schedule', | ||
'editor.warning_time': 'Warning Time', | ||
'editor.danger_time': 'Danger Time', | ||
'editor.event_visibility': 'Event Visibility', | ||
'editor.timer_type': 'Timer Type', | ||
'editor.end_action': 'End Action', | ||
'editor.eventid': 'Event ID (Read Only)', | ||
'editor.upnext': 'UP NEXT', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translate 'editor' related entries to Portuguese
The 'editor' related entries are currently in English. Please translate them to Portuguese, paying special attention to technical terms:
- 'editor.run': 'Run',
- 'editor.edit': 'Edit',
- 'editor.event':'Event',
- 'editor.delay':'Delay',
- 'editor.block':'Block',
- 'editor.gap': 'Gap',
- 'editor.nextday': 'Next Day',
- 'editor.clear':'Clear Rundown',
- 'editor.event_schedule': 'Event Schedule',
- 'editor.warning_time': 'Warning Time',
- 'editor.danger_time': 'Danger Time',
- 'editor.event_visibility': 'Event Visibility',
- 'editor.timer_type': 'Timer Type',
- 'editor.end_action': 'End Action',
- 'editor.eventid': 'Event ID (Read Only)',
- 'editor.upnext': 'UP NEXT',
+ 'editor.run': 'Executar',
+ 'editor.edit': 'Editar',
+ 'editor.event': 'Evento',
+ 'editor.delay': 'Atraso',
+ 'editor.block': 'Bloco',
+ 'editor.gap': 'Intervalo',
+ 'editor.nextday': 'Próximo dia',
+ 'editor.clear': 'Limpar roteiro',
+ 'editor.event_schedule': 'Programação do evento',
+ 'editor.warning_time': 'Tempo de aviso',
+ 'editor.danger_time': 'Tempo crítico',
+ 'editor.event_visibility': 'Visibilidade do evento',
+ 'editor.timer_type': 'Tipo de temporizador',
+ 'editor.end_action': 'Ação final',
+ 'editor.eventid': 'ID do evento (Somente leitura)',
+ 'editor.upnext': 'A SEGUIR',
Please verify these translations with a native Portuguese speaker or a professional translator to ensure accuracy and appropriate use of technical terms in Portuguese.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'editor.run': 'Run', | |
'editor.edit': 'Edit', | |
'editor.event':'Event', | |
'editor.delay':'Delay', | |
'editor.block':'Block', | |
'editor.gap': 'Gap', | |
'editor.nextday': 'Next Day', | |
'editor.clear':'Clear Rundown', | |
'editor.event_schedule': 'Event Schedule', | |
'editor.warning_time': 'Warning Time', | |
'editor.danger_time': 'Danger Time', | |
'editor.event_visibility': 'Event Visibility', | |
'editor.timer_type': 'Timer Type', | |
'editor.end_action': 'End Action', | |
'editor.eventid': 'Event ID (Read Only)', | |
'editor.upnext': 'UP NEXT', | |
'editor.run': 'Executar', | |
'editor.edit': 'Editar', | |
'editor.event': 'Evento', | |
'editor.delay': 'Atraso', | |
'editor.block': 'Bloco', | |
'editor.gap': 'Intervalo', | |
'editor.nextday': 'Próximo dia', | |
'editor.clear': 'Limpar roteiro', | |
'editor.event_schedule': 'Programação do evento', | |
'editor.warning_time': 'Tempo de aviso', | |
'editor.danger_time': 'Tempo crítico', | |
'editor.event_visibility': 'Visibilidade do evento', | |
'editor.timer_type': 'Tipo de temporizador', | |
'editor.end_action': 'Ação final', | |
'editor.eventid': 'ID do evento (Somente leitura)', | |
'editor.upnext': 'A SEGUIR', |
'common.elapsed_time': 'Elapsed Time', | ||
'common.progress': 'Progress', | ||
'common.offset': 'Offset', | ||
'common.aux_time': 'Auxiliary Timer', | ||
'timer.message': 'Timer Message', | ||
'timer.message.plac': 'Message show fullscreen stage timer', | ||
'timer.external': 'External Message', | ||
'timer.external.plac': 'Message show as secondary text in stage timer', | ||
'timer.show_auxtime': 'Show Aux Timer', | ||
'timer.show_external': 'Show External', | ||
'timer.blink': 'blink', | ||
'timer.blackout': 'Blackout Screen', | ||
'timer.countdown': 'Countdown', | ||
'timer.countup': 'Count Up', | ||
'timer.timetoend': 'Time to End', | ||
'timer.clock': 'Clock', | ||
'editor.run': 'Run', | ||
'editor.edit': 'Edit', | ||
'editor.event':'Event', | ||
'editor.delay':'Delay', | ||
'editor.block':'Block', | ||
'editor.gap': 'Gap', | ||
'editor.nextday': 'Next Day', | ||
'editor.clear':'Clear Rundown', | ||
'editor.event_schedule': 'Event Schedule', | ||
'editor.warning_time': 'Warning Time', | ||
'editor.danger_time': 'Danger Time', | ||
'editor.event_visibility': 'Event Visibility', | ||
'editor.timer_type': 'Timer Type', | ||
'editor.end_action': 'End Action', | ||
'editor.eventid': 'Event ID (Read Only)', | ||
'editor.upnext': 'UP NEXT', | ||
'endaction.none': 'None', | ||
'endaction.stop': 'Stop', | ||
'endaction.load': 'Load Next', | ||
'endaction.play': 'Play Next', | ||
'global.save': 'Save', | ||
'global.delete': 'Delete', | ||
'global.delete_all': 'Delete All', | ||
'global.exit': 'Exit', | ||
'global.cancel': 'Cancel', | ||
'global.public': 'Public', | ||
'global.private': 'Private', | ||
'global.cue': 'Cue', | ||
'global.title': 'Title', | ||
'global.note': 'Note', | ||
'global.colour': 'Colour', | ||
'global.custom_fields': 'Custom Fields', | ||
'global.manage': 'Manage', | ||
'alert.clear_rundown': 'You will lose all data in your rundown. Are you sure?', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Issue Found: Unrelated and Untranslated Entries in German Translation File
The changes in apps/client/src/translation/languages/de.ts
are unrelated to the PR's objective of adding Brazilian Portuguese translations. Additionally, the new entries added are in English instead of German. This inconsistency needs to be addressed:
- Revert the changes to
de.ts
in the current PR. - Create a separate PR dedicated to updating German translations, ensuring all entries are correctly translated to German.
🔗 Analysis chain
Changes are inconsistent with PR objective and file purpose
The changes in this file appear to be unrelated to the PR's objective of adding Brazilian Portuguese translations. This file is for German translations (de.ts
), but most of the new entries are in English. This inconsistency needs to be addressed:
- These changes should be moved to a separate PR focused on updating German translations.
- All new entries should be properly translated into German before being added to this file.
To resolve this, please:
- Revert these changes in the current PR.
- Create a new PR specifically for updating German translations.
- Ensure all entries are correctly translated to German in the new PR.
To confirm that these are the only changes to German translations in this PR, run:
Would you like assistance in creating a separate PR for these German translation updates?
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Check for changes in German translation files
git diff origin/main -- '**/de.ts' '**/de.json'
Length of output: 83
Script:
#!/bin/bash
# List all remote branches to identify the correct main branch name
git branch -r
Length of output: 62
Script:
#!/bin/bash
# Check for changes in German translation files against origin/master
git diff origin/master -- '**/de.ts' '**/de.json'
Length of output: 2454
{isPublic ? 'Public' : 'Private'} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update visibility switch label for internationalization
The visibility switch label still uses hardcoded strings 'Public' and 'Private'. To maintain consistency with the internationalization efforts in the rest of the component, consider updating these strings to use getLocalizedString
.
Here's a suggested change:
- {isPublic ? 'Public' : 'Private'}
+ {isPublic ? getLocalizedString('visibility.public') : getLocalizedString('visibility.private')}
Make sure to add the corresponding translation keys to your translation files.
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
{isPublic ? 'Public' : 'Private'} | |
{isPublic ? getLocalizedString('visibility.public') : getLocalizedString('visibility.private')} | |
'common.elapsed_time': 'Elapsed Time', | ||
'common.progress': 'Progress', | ||
'common.offset': 'Offset', | ||
'common.aux_time': 'Auxiliary Timer', | ||
'timer.message': 'Timer Message', | ||
'timer.message.plac': 'Message show fullscreen stage timer', | ||
'timer.external': 'External Message', | ||
'timer.external.plac': 'Message show as secondary text in stage timer', | ||
'timer.show_auxtime': 'Show Aux Timer', | ||
'timer.show_external': 'Show External', | ||
'timer.blink': 'blink', | ||
'timer.blackout': 'Blackout Screen', | ||
'timer.countdown': 'Countdown', | ||
'timer.countup': 'Count Up', | ||
'timer.timetoend': 'Time to End', | ||
'timer.clock': 'Clock', | ||
'editor.run': 'Run', | ||
'editor.edit': 'Edit', | ||
'editor.event':'Event', | ||
'editor.delay':'Delay', | ||
'editor.block':'Block', | ||
'editor.gap': 'Gap', | ||
'editor.nextday': 'Next Day', | ||
'editor.clear':'Clear Rundown', | ||
'editor.event_schedule': 'Event Schedule', | ||
'editor.warning_time': 'Warning Time', | ||
'editor.danger_time': 'Danger Time', | ||
'editor.event_visibility': 'Event Visibility', | ||
'editor.timer_type': 'Timer Type', | ||
'editor.end_action': 'End Action', | ||
'editor.eventid': 'Event ID (Read Only)', | ||
'editor.upnext': 'UP NEXT', | ||
'endaction.none': 'None', | ||
'endaction.stop': 'Stop', | ||
'endaction.load': 'Load Next', | ||
'endaction.play': 'Play Next', | ||
'global.save': 'Save', | ||
'global.delete': 'Delete', | ||
'global.delete_all': 'Delete All', | ||
'global.exit': 'Exit', | ||
'global.cancel': 'Cancel', | ||
'global.public': 'Public', | ||
'global.private': 'Private', | ||
'global.cue': 'Cue', | ||
'global.title': 'Title', | ||
'global.note': 'Note', | ||
'global.colour': 'Colour', | ||
'global.custom_fields': 'Custom Fields', | ||
'global.manage': 'Manage', | ||
'alert.clear_rundown': 'You will lose all data in your rundown. Are you sure?', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Translate new entries to Spanish
Several new entries have values in English instead of Spanish. Since this is the Spanish translation file, please provide the appropriate Spanish translations to maintain consistency.
Apply this diff to provide the Spanish translations:
- 'common.elapsed_time': 'Elapsed Time',
+ 'common.elapsed_time': 'Tiempo transcurrido',
- 'common.progress': 'Progress',
+ 'common.progress': 'Progreso',
- 'common.offset': 'Offset',
+ 'common.offset': 'Desfase',
- 'common.aux_time': 'Auxiliary Timer',
+ 'common.aux_time': 'Temporizador auxiliar',
- 'timer.message': 'Timer Message',
+ 'timer.message': 'Mensaje del temporizador',
- 'timer.message.plac': 'Message show fullscreen stage timer',
+ 'timer.message.plac': 'Mensaje que se muestra en el temporizador de escenario a pantalla completa',
- 'timer.external': 'External Message',
+ 'timer.external': 'Mensaje externo',
- 'timer.external.plac': 'Message show as secondary text in stage timer',
+ 'timer.external.plac': 'Mensaje que se muestra como texto secundario en el temporizador de escenario',
- 'timer.show_auxtime': 'Show Aux Timer',
+ 'timer.show_auxtime': 'Mostrar temporizador auxiliar',
- 'timer.show_external': 'Show External',
+ 'timer.show_external': 'Mostrar externo',
- 'timer.blink': 'blink',
+ 'timer.blink': 'parpadeo',
- 'timer.blackout': 'Blackout Screen',
+ 'timer.blackout': 'Pantalla en negro',
- 'timer.countdown': 'Countdown',
+ 'timer.countdown': 'Cuenta regresiva',
- 'timer.countup': 'Count Up',
+ 'timer.countup': 'Cuenta ascendente',
- 'timer.timetoend': 'Time to End',
+ 'timer.timetoend': 'Tiempo para finalizar',
- 'timer.clock': 'Clock',
+ 'timer.clock': 'Reloj',
- 'editor.run': 'Run',
+ 'editor.run': 'Ejecutar',
- 'editor.edit': 'Edit',
+ 'editor.edit': 'Editar',
- 'editor.event': 'Event',
+ 'editor.event': 'Evento',
- 'editor.delay': 'Delay',
+ 'editor.delay': 'Retraso',
- 'editor.block': 'Block',
+ 'editor.block': 'Bloque',
- 'editor.gap': 'Gap',
+ 'editor.gap': 'Hueco',
- 'editor.nextday': 'Next Day',
+ 'editor.nextday': 'Día siguiente',
- 'editor.clear': 'Clear Rundown',
+ 'editor.clear': 'Borrar guion',
- 'editor.event_schedule': 'Event Schedule',
+ 'editor.event_schedule': 'Programa del evento',
- 'editor.warning_time': 'Warning Time',
+ 'editor.warning_time': 'Tiempo de advertencia',
- 'editor.danger_time': 'Danger Time',
+ 'editor.danger_time': 'Tiempo de peligro',
- 'editor.event_visibility': 'Event Visibility',
+ 'editor.event_visibility': 'Visibilidad del evento',
- 'editor.timer_type': 'Timer Type',
+ 'editor.timer_type': 'Tipo de temporizador',
- 'editor.end_action': 'End Action',
+ 'editor.end_action': 'Acción al finalizar',
- 'editor.eventid': 'Event ID (Read Only)',
+ 'editor.eventid': 'ID de evento (Solo lectura)',
- 'editor.upnext': 'UP NEXT',
+ 'editor.upnext': 'PRÓXIMO',
- 'endaction.none': 'None',
+ 'endaction.none': 'Ninguno',
- 'endaction.stop': 'Stop',
+ 'endaction.stop': 'Detener',
- 'endaction.load': 'Load Next',
+ 'endaction.load': 'Cargar siguiente',
- 'endaction.play': 'Play Next',
+ 'endaction.play': 'Reproducir siguiente',
- 'global.save': 'Save',
+ 'global.save': 'Guardar',
- 'global.delete': 'Delete',
+ 'global.delete': 'Eliminar',
- 'global.delete_all': 'Delete All',
+ 'global.delete_all': 'Eliminar todo',
- 'global.exit': 'Exit',
+ 'global.exit': 'Salir',
- 'global.cancel': 'Cancel',
+ 'global.cancel': 'Cancelar',
- 'global.public': 'Public',
+ 'global.public': 'Público',
- 'global.private': 'Private',
+ 'global.private': 'Privado',
- 'global.cue': 'Cue',
+ 'global.cue': 'Señal',
- 'global.title': 'Title',
+ 'global.title': 'Título',
- 'global.note': 'Note',
+ 'global.note': 'Nota',
- 'global.colour': 'Colour',
+ 'global.colour': 'Color',
- 'global.custom_fields': 'Custom Fields',
+ 'global.custom_fields': 'Campos personalizados',
- 'global.manage': 'Manage',
+ 'global.manage': 'Gestionar',
- 'alert.clear_rundown': 'You will lose all data in your rundown. Are you sure?',
+ 'alert.clear_rundown': 'Perderá todos los datos de su guion. ¿Está seguro?',
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
'common.elapsed_time': 'Elapsed Time', | |
'common.progress': 'Progress', | |
'common.offset': 'Offset', | |
'common.aux_time': 'Auxiliary Timer', | |
'timer.message': 'Timer Message', | |
'timer.message.plac': 'Message show fullscreen stage timer', | |
'timer.external': 'External Message', | |
'timer.external.plac': 'Message show as secondary text in stage timer', | |
'timer.show_auxtime': 'Show Aux Timer', | |
'timer.show_external': 'Show External', | |
'timer.blink': 'blink', | |
'timer.blackout': 'Blackout Screen', | |
'timer.countdown': 'Countdown', | |
'timer.countup': 'Count Up', | |
'timer.timetoend': 'Time to End', | |
'timer.clock': 'Clock', | |
'editor.run': 'Run', | |
'editor.edit': 'Edit', | |
'editor.event':'Event', | |
'editor.delay':'Delay', | |
'editor.block':'Block', | |
'editor.gap': 'Gap', | |
'editor.nextday': 'Next Day', | |
'editor.clear':'Clear Rundown', | |
'editor.event_schedule': 'Event Schedule', | |
'editor.warning_time': 'Warning Time', | |
'editor.danger_time': 'Danger Time', | |
'editor.event_visibility': 'Event Visibility', | |
'editor.timer_type': 'Timer Type', | |
'editor.end_action': 'End Action', | |
'editor.eventid': 'Event ID (Read Only)', | |
'editor.upnext': 'UP NEXT', | |
'endaction.none': 'None', | |
'endaction.stop': 'Stop', | |
'endaction.load': 'Load Next', | |
'endaction.play': 'Play Next', | |
'global.save': 'Save', | |
'global.delete': 'Delete', | |
'global.delete_all': 'Delete All', | |
'global.exit': 'Exit', | |
'global.cancel': 'Cancel', | |
'global.public': 'Public', | |
'global.private': 'Private', | |
'global.cue': 'Cue', | |
'global.title': 'Title', | |
'global.note': 'Note', | |
'global.colour': 'Colour', | |
'global.custom_fields': 'Custom Fields', | |
'global.manage': 'Manage', | |
'alert.clear_rundown': 'You will lose all data in your rundown. Are you sure?', | |
'common.elapsed_time': 'Tiempo transcurrido', | |
'common.progress': 'Progreso', | |
'common.offset': 'Desfase', | |
'common.aux_time': 'Temporizador auxiliar', | |
'timer.message': 'Mensaje del temporizador', | |
'timer.message.plac': 'Mensaje que se muestra en el temporizador de escenario a pantalla completa', | |
'timer.external': 'Mensaje externo', | |
'timer.external.plac': 'Mensaje que se muestra como texto secundario en el temporizador de escenario', | |
'timer.show_auxtime': 'Mostrar temporizador auxiliar', | |
'timer.show_external': 'Mostrar externo', | |
'timer.blink': 'parpadeo', | |
'timer.blackout': 'Pantalla en negro', | |
'timer.countdown': 'Cuenta regresiva', | |
'timer.countup': 'Cuenta ascendente', | |
'timer.timetoend': 'Tiempo para finalizar', | |
'timer.clock': 'Reloj', | |
'editor.run': 'Ejecutar', | |
'editor.edit': 'Editar', | |
'editor.event': 'Evento', | |
'editor.delay': 'Retraso', | |
'editor.block': 'Bloque', | |
'editor.gap': 'Hueco', | |
'editor.nextday': 'Día siguiente', | |
'editor.clear': 'Borrar guion', | |
'editor.event_schedule': 'Programa del evento', | |
'editor.warning_time': 'Tiempo de advertencia', | |
'editor.danger_time': 'Tiempo de peligro', | |
'editor.event_visibility': 'Visibilidad del evento', | |
'editor.timer_type': 'Tipo de temporizador', | |
'editor.end_action': 'Acción al finalizar', | |
'editor.eventid': 'ID de evento (Solo lectura)', | |
'editor.upnext': 'PRÓXIMO', | |
'endaction.none': 'Ninguno', | |
'endaction.stop': 'Detener', | |
'endaction.load': 'Cargar siguiente', | |
'endaction.play': 'Reproducir siguiente', | |
'global.save': 'Guardar', | |
'global.delete': 'Eliminar', | |
'global.delete_all': 'Eliminar todo', | |
'global.exit': 'Salir', | |
'global.cancel': 'Cancelar', | |
'global.public': 'Público', | |
'global.private': 'Privado', | |
'global.cue': 'Señal', | |
'global.title': 'Título', | |
'global.note': 'Nota', | |
'global.colour': 'Color', | |
'global.custom_fields': 'Campos personalizados', | |
'global.manage': 'Gestionar', | |
'alert.clear_rundown': 'Perderá todos los datos de su guion. ¿Está seguro?', |
Hi @Cicatelli, thank you for your work here You did not ask for a review, but from your inactivity I assume that you are finished with the code you are proposing to merge Unfortunately we cannot consider merging the PR in the current state.
The first one is completely fine, and we could isolate the change and merge without issues. I currently did not see that much difference between the existing portuguese and would be more inclined to revise the existing portuguese translation As for the second, this is something that we would need to discuss as it is a major project change. It currently achieves so at the cost of every other translatio being unimplemented. It also commits us to maintain translations for the entire interface This is not sustainable and likely something we dont want to do. The current decision is that the signage views are localisable, while the production views are always in english. Changes to this principle would need to be properly investigated and likely supported by a group of users who could provide translations on demand I hope this does not discourage your contribution and is taken in the way that is meant. |
Hi @cpvalente! The changes presented were a personal need and I made them available since a complete translation of the interfaces could help other people. I understand the big change to implement translation variables for the entire code. I did not close the translation variables in the entire code, only for the EDITOR view. There is still a lot to do in the other views, however, due to work I have not been able to continue yet... Regarding the PT vs PT-BR language, there are some terms that sound strange due to cultural differences, and just to avoid changing a language that already exists in the system, I decided to create another one. I would like to thank you for the excellent work you have been doing with this code, which has helped me a lot! I hope that within the scope of my knowledge, I can help the growth of a system that has helped me so much. I know little about high-level programming, my area is electrical engineering, the little I know about JS is as a hobby. |
Hi @Cicatelli , thank you for this. I appreciate your involvement and your help. Meanwhile, if you would like to contribute just reach out and we can find a task that aligns with the roadmap. The easiest way to reach out is likely on discord |
Added Brazilian Portuguese language to the translation system and added translator codes to the operator view
Adicionado ao sistema de tradução o idioma português brasileiro e adicionado códigos do tradutor a visualização do operador