Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Use fallback translations #1458

Merged

Conversation

Lily418
Copy link

@Lily418 Lily418 commented Jul 18, 2018

Fixes #1457

The problem I encounted when creating this PR is that Ember-i18n's Default Locale Fallback works when the key is missing from the translation but I would prefer to include the key and provide a value which allows translation contributors to see more easily what translation keys are defined.

I cannot use empty string as has previously been used because Ember-i18n will not call missing message so instead I've updated this to be undefined.

Then I added a function for missing message which uses the default locale which I took from here jamesarosen/ember-i18n#256 (comment)

Changes proposed in this pull request:

  • Use undefined rather than empty string when translation is missing, this means result of missingMessage function will be used rather than empty string
  • Add app/utils/i18n/missing-message.js
  • Update contibution guide to reflect the above change

@Lily418
Copy link
Author

Lily418 commented Jul 19, 2018

Tests are currently failing because of this issue with the newer version of ember-i18n in Electron.
jamesarosen/ember-i18n#480

I imagine this is also the reason #1428 is failing.

For now I'm going to revert to the older version of ember-i18n as that wasn't the main change here.

@stukalin stukalin merged commit cb79f1a into HospitalRun:master Jul 19, 2018
@Lily418 Lily418 deleted the gh-1457-translation-sync-empty-strings branch July 19, 2018 10:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants