brave / ads-ui

Self-service ads UI
Mozilla Public License 2.0
23 stars 11 forks source link

feat: Spanish localization #1137

Closed IanKrieger closed 6 months ago

IanKrieger commented 6 months ago

Spanish translation for: https://github.com/brave/roadmap/issues/1115


Screen Shot 2024-03-18 at 7 55 41 AM
github-actions[bot] commented 6 months ago

[puLL-Merge] - brave/ads-ui@1137

Description

This pull request makes adjustments to the localization files and other components to ensure consistency in the naming and organization of various features across different localizations. The primary change involves the correction of the term "AdSets" to "Ad Sets" in the SearchCampaignReportView.tsx file to maintain coherence with other parts of the codebase.

Changes ### Changes - **src/locales/en.js:** Deletion of the file. - **src/locales/en.po:** Minor changes, including fixing references to line numbers in source files. - **src/locales/es.js:** Deletion of the file. - **src/locales/pt.js:** Deletion of the file. - **src/locales/es.po, src/locales/pt.po:** Similar to `en.po`, these files have changes regarding references to line numbers in source files. - **src/user/views/user/reports/SearchCampaignReportView.tsx:** Modification of the header from `AdSets` to `Ad Sets` to standardize the term across the codebase.

Security Hotspots

IanKrieger commented 6 months ago

But how do I test this? I'd like to see an easy way to bring up the dashboard in spanish so I can review what English test is still showing.

I changed brave beta browser's primary language to be in spanish, as seen in the screenshot I added. Will have to deploy to make sure behaviour is the same,

Also, as we change the english strings later, what breaks / reports to give us feedback that we now need additional strings translated?

That should be handled when you run npm run extract any changes to text are matched against an exact id which in this case is basically the text. if that id doesn't exist, it says a translation is missing.

tackley commented 6 months ago

But how do I test this? I'd like to see an easy way to bring up the dashboard in spanish so I can review what English test is still showing.

I changed brave beta browser's primary language to be in spanish, as seen in the screenshot I added. Will have to deploy to make sure behaviour is the same,

OK! In a future PR I'd like us to make trying different locales easier (perhaps also including the pseudolocale) for testing. Either by 1) supporting a locale=en-US query parameter on application load to force the locale detection or 2) (less preferred) a dev time env var e.g. OVERRIDE_LOCALE=en-US npm start or 3) (even less preferred) writing up in the readme how to switch locales in the brave. But not as part of this PR.

I didn't see the screenshot when I first wrote the comment ;)

Also, as we change the english strings later, what breaks / reports to give us feedback that we now need additional strings translated?

That should be handled when you run npm run extract any changes to text are matched against an exact id which in this case is basically the text. if that id doesn't exist, it says a translation is missing.

Ahh, yes, that makes sense. I think in due course we'll lose track, and I'd like a build-time check / report if possible - especially if the values have changed - but again let's hold off on that for now.