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

Fix i18n fallback configuration conflicts with environment configurations #6843

Merged
merged 1 commit into from
Mar 20, 2018

Conversation

akihikodaki
Copy link
Contributor

This fixes a bug reported at #6841 (comment).

@akihikodaki akihikodaki added the bug Something isn't working label Mar 20, 2018
@@ -56,7 +56,7 @@

# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
Copy link
Member

Choose a reason for hiding this comment

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

Is this comment still accurate? Seems like it should say something more like "make lookups for any locale fall back to 'en'"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No. Addressed in 7820893. Thanks for pointing out this.

@ineffyble
Copy link
Member

To clarify how this works for my own benefit:

  • Instance owner sets a default locale via environment variable
  • This default locale is used for all the localised strings shown within Mastodon
  • If a string is not available in this locale, Mastodon will instead use the English version of the string

In addition:

  • If the default locale is not provided, or is unavailable or invalid, it is set to English

Does that all sound right?

@akihikodaki
Copy link
Contributor Author

Yes. And it has been the expected behavior, so it is a bug if it doesn't work as you stated. (That's why this pull request is labelled bug here.)

Copy link
Member

@nightpool nightpool left a comment

Choose a reason for hiding this comment

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

i just touched this code recently for cybrespace-specific locale changes, so i can confirm this is the correct change to make. thanks aki!

@nightpool
Copy link
Member

nightpool commented Mar 20, 2018

(to be clear, the bug here is that we were setting .fallbacks = [:en] in application.rb, but it was getting overwritten later by the default .fallbacks = true in production.rb)

@Gargron Gargron merged commit 61dcb68 into mastodon:master Mar 20, 2018
smorimoto pushed a commit to kibousoft/mastodon that referenced this pull request Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants