Skip to content
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

Update locales.js for support pl language #6301

Merged
merged 21 commits into from
Jul 25, 2024

Conversation

fcientymeh
Copy link
Contributor

@fcientymeh fcientymeh commented Apr 1, 2024

Description

Opensearch-dashboard uses two kinds of translating engines:

<FormattedMessage> and i18n.translate.

i18n.translate works from scratch, but <FormattedMessage> needs to have localization country shortcut in locales.js file. If not - opensearch-dashboards must be build from source with newly added new localization country. This is very problematic.
I didn't found other solution.

Ultimately, adding support for a new language should not force compilation of the product

Testing the changes

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link

codecov bot commented Apr 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.20%. Comparing base (45d34b5) to head (98001e6).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6301   +/-   ##
=======================================
  Coverage   54.20%   54.20%           
=======================================
  Files        3251     3251           
  Lines       70655    70657    +2     
  Branches    10828    10828           
=======================================
+ Hits        38300    38302    +2     
  Misses      30334    30334           
  Partials     2021     2021           
Flag Coverage Δ
Linux_1 30.76% <100.00%> (+<0.01%) ⬆️
Linux_2 55.60% <100.00%> (+<0.01%) ⬆️
Windows_1 30.77% <100.00%> (+<0.01%) ⬆️
Windows_2 55.56% <100.00%> (+<0.01%) ⬆️
Windows_4 31.49% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ashwin-pc
Copy link
Member

Hi @fcientymeh Can you add details to the PR description's sections so that its clear what this change is addressing?

@fcientymeh
Copy link
Contributor Author

@ashwin-pc - thank you for your feedback. Generally speaking - we needs (I hope many others too) to have localized opensearch-dashboards. The problem is that adding translation support for <FormattedMessage> requires recompiling the product,, if theres is no locale defined in locales.js file for some new country.

I think this could be separated as a new issue.

@kavilla
Copy link
Member

kavilla commented Apr 5, 2024

Thanks for doing this. Yes this is a known issue. It requires the update this for functional purposes along with the translation.

Looks good to me as much as I can verify.

@kavilla kavilla added i18n Internationalization related Issues and PRs backport 2.x labels Apr 5, 2024
@BionIT
Copy link
Collaborator

BionIT commented Jun 5, 2024

Hi @ashwin-pc and @kavilla , should we mark this PR for 2.15?

@ananzh ananzh merged commit 930039a into opensearch-project:main Jul 25, 2024
40 of 67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 25, 2024
* Update locales.js for support pl language

Needed for translating FormatMessage format

Signed-off-by: Andrzej M. <[email protected]>

* Update locales.js for pl language / translate tokens

Signed-off-by: Andrzej M. <[email protected]>

* Update locales.js

Signed-off-by: AndrzejM <[email protected]>

---------

Signed-off-by: Andrzej M. <[email protected]>
Signed-off-by: Andrzej M. <[email protected]>
Signed-off-by: AndrzejM <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>
(cherry picked from commit 930039a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jul 25, 2024
* Update locales.js for support pl language

Needed for translating FormatMessage format

Signed-off-by: Andrzej M. <[email protected]>

* Update locales.js for pl language / translate tokens

Signed-off-by: Andrzej M. <[email protected]>

* Update locales.js

Signed-off-by: AndrzejM <[email protected]>

---------

Signed-off-by: Andrzej M. <[email protected]>
Signed-off-by: Andrzej M. <[email protected]>
Signed-off-by: AndrzejM <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>
(cherry picked from commit 930039a)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ananzh added a commit that referenced this pull request Jul 25, 2024
* Update locales.js for support pl language

Needed for translating FormatMessage format



* Update locales.js for pl language / translate tokens



* Update locales.js



---------





(cherry picked from commit 930039a)

Signed-off-by: Andrzej M. <[email protected]>
Signed-off-by: Andrzej M. <[email protected]>
Signed-off-by: AndrzejM <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Anan Zhuang <[email protected]>
Qxisylolo pushed a commit to Qxisylolo/OpenSearch-Dashboards that referenced this pull request Aug 1, 2024
* Update locales.js for support pl language

Needed for translating FormatMessage format

Signed-off-by: Andrzej M. <[email protected]>

* Update locales.js for pl language / translate tokens

Signed-off-by: Andrzej M. <[email protected]>

* Update locales.js

Signed-off-by: AndrzejM <[email protected]>

---------

Signed-off-by: Andrzej M. <[email protected]>
Signed-off-by: Andrzej M. <[email protected]>
Signed-off-by: AndrzejM <[email protected]>
Co-authored-by: Anan Zhuang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport 2.16 first-time-contributor i18n Internationalization related Issues and PRs needs more info Requires more information from poster v2.16.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants