Skip to content

Introduce translations and translate library for internationalization#1969

Merged
iwiznia merged 4 commits into
Expensify:masterfrom
tugbadogan:tugbadogan-translate-library
Mar 23, 2021
Merged

Introduce translations and translate library for internationalization#1969
iwiznia merged 4 commits into
Expensify:masterfrom
tugbadogan:tugbadogan-translate-library

Conversation

@tugbadogan

Copy link
Copy Markdown
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

@flodnv flodnv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Exciting!!

Comment thread src/languages/es-ES.js
@@ -0,0 +1,9 @@
import en from './en';
import es from './es';
import esES from './es-ES';

Copy link
Copy Markdown
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
Copy Markdown
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.

Comment thread src/libs/translate.js Outdated
Comment thread src/libs/translate.js Outdated
Comment thread src/libs/translate.js
Comment thread tests/unit/TranslateTest.js Outdated
Comment thread tests/unit/TranslateTest.js Outdated
iwiznia
iwiznia previously approved these changes Mar 22, 2021
Comment thread src/libs/translate.js Outdated
Comment thread tests/unit/TranslateTest.js Outdated
@tugbadogan

Copy link
Copy Markdown
Contributor Author

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

@flodnv flodnv left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown

@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
Copy Markdown
Contributor Author

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

@roryabraham

Copy link
Copy Markdown
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

iwiznia commented Mar 25, 2021

Copy link
Copy Markdown
Contributor

@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
Copy Markdown
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