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

Introduce translations and translate library for internationalization #1969

Merged
merged 4 commits into from
Mar 23, 2021
Merged

Introduce translations and translate library for internationalization #1969

merged 4 commits into from
Mar 23, 2021

Conversation

tugbadogan
Copy link
Contributor

@iwiznia @arielgreen

Details

  • Added sample locale files.
  • Added translations module that export all languages.
  • Added translate library that returns translated string of given locale key and optional variables.

Fixed Issues

Fixes #1844

Tests

Unit Tests are added.
Manually tested function to see if it returns translated string or logs an alert to server.

Tested On

  • Web
  • Mobile Web
  • Desktop
  • iOS
  • Android

@tugbadogan tugbadogan requested a review from a team as a code owner March 21, 2021 18:17
@botify botify requested review from flodnv and removed request for a team March 21, 2021 18:17
@flodnv flodnv requested a review from iwiznia March 22, 2021 11:36
Copy link
Contributor

@flodnv flodnv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exciting!!

src/languages/es-ES.js Show resolved Hide resolved
@@ -0,0 +1,9 @@
import en from './en';
import es from './es';
import esES from './es-ES';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not name this es-ES instead of esES ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In JS, variable/module/function names can't contain -. Maybe, we can use _ here instead.

src/libs/translate.js Outdated Show resolved Hide resolved
src/libs/translate.js Outdated Show resolved Hide resolved
src/libs/translate.js Show resolved Hide resolved
tests/unit/TranslateTest.js Outdated Show resolved Hide resolved
tests/unit/TranslateTest.js Outdated Show resolved Hide resolved
iwiznia
iwiznia previously approved these changes Mar 22, 2021
src/libs/translate.js Outdated Show resolved Hide resolved
tests/unit/TranslateTest.js Outdated Show resolved Hide resolved
@tugbadogan
Copy link
Contributor Author

@iwiznia @flodnv Updated the PR to address your comments. Can you review again?

Copy link
Contributor

@flodnv flodnv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! @iwiznia all yours

@iwiznia iwiznia merged commit c769457 into Expensify:master Mar 23, 2021
@tugbadogan tugbadogan deleted the tugbadogan-translate-library branch March 24, 2021 14:50
@isagoico
Copy link

@tugbadogan Hello! This PR looks like internal QA. If so, can you let me know when it's QA'd in staging so I can check it off the deploy list? Thanks in advance!

@tugbadogan
Copy link
Contributor Author

@isagoico Sorry, what does internal QA mean? I’m not sure if it applies to this PR.

@roryabraham
Copy link
Contributor

@tugbadogan, could you please do your best to write up a set of steps that can be taken to verify that this PR works as expected? We're working on implementing a QA process, so going forward we're going to need QA steps for all PRs so that they can undergo QA before being deployed to production.

@iwiznia
Copy link
Contributor

iwiznia commented Mar 25, 2021

@roryabraham this is not QAable really, since it's part of a larger project and this is just one of the bases of that project. We will be able to do QA following the test steps defined in the design doc, once all the pieces are done.

@roryabraham
Copy link
Contributor

Thanks @iwiznia!

So in that case @tugbadogan, no need to follow-up on this comment 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement library to get texts
5 participants