Skip to content

Conversation

@IvanScoles
Copy link
Collaborator

@IvanScoles IvanScoles commented Jul 31, 2018

I18n integrated with: https://github.com/artisavotins/react-i18nify-lite

Translation file: webapp/app/lang/en.js

Service to handle i18n global in the app: i18nService

Without parameters:

{i18nService.translate('text.save')}`

With parameters:

{i18nService.translate('text.delete_user', { name: user.name })}

Also you can use components to translate, with your render methods

Without parameters:

import { Translate } from 'react-i18nify-lite';

<Translate value="button.save"/>

With parameters:

import { Translate } from 'react-i18nify-lite';

<Translate value="text.delete_user" name={user.name} />

"users_list": "Users List",
"username_or_email": "Username or email address"
}
}
Copy link
Member

@emanuelmetal emanuelmetal Jul 31, 2018

Choose a reason for hiding this comment

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

What do you think about organizing keys by module EG:

homePage: {
  "users:_list": "...",
},
actionButtons: {
  ""
},
usersForm: {
  ...
"phone_number": "Phone Number",
  ...
}

@mravinale @RamiroGonzalez89 what do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could be a good approach, but in this case, you can repeat keys with this approach. For example username, email and phone are repeated for the table and modal. Depends on the project, the best configuration to do.
i18nkeys

Copy link
Member

Choose a reason for hiding this comment

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

ok I agree

@IvanScoles IvanScoles changed the title Internacionalization - i18n with react-i18nify-lite Internationalization - i18n with react-i18nify-lite Aug 1, 2018
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.

3 participants