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

Problem with i18n when page is not translated to all target languages #2529

Open
guillerodriguez opened this issue Jan 28, 2022 · 7 comments
Labels

Comments

@guillerodriguez
Copy link
Contributor

Expected behavior and actual behavior

I have a Middleman site which is translated to 4 languages: en, es, de, fr. i18n config is as follows:

activate :i18n, :langs => [:en, :es, :de, :fr], :mount_at_root => false

For most pages there is a single source file which lives under source/localizable; i18n-specific strings are translated via the <%= t('key') %> helper. This works fine.

For some pages, though, there are different language specific versions.

If a language-specific version is available for all languages, then this works fine as well. Let's assume I have:

  • source/localizable/test.html.erb
  • source/localizable/test.es.html.erb
  • source/localizable/test.fr.html.erb
  • source/localizable/test.de.html.erb

If I build the site then all works as expected.

However if the language-specific version is missing for some languages, then the "default" version seems to be used for all languages. Let's assume I have:

  • source/localizable/test.html.erb
  • source/localizable/test.es.html.erb

When I build the site, I see that the default version is used for French and German (good) but also for Spanish (bad)

Not sure if this is related but in the build log I see:

      create  build/en/test.html
      create  build/es/test.html
      create  build/fr/test.html
      create  build/de/test.html
   identical  build/es/test.html

The Spanish page is being processed twice -- but both times with the wrong content (the content for the default language).

Steps to reproduce the problem (from a clean middleman installation)

See above.

Additional information

  • Ruby version: ruby 2.6.8p205 (2021-07-07 revision 67951) [arm64-darwin20]
  • Middleman version: I was using 4.3 but this is also reproducible with 4.4.2
  • OS version: macOS BigSur 11.6 with Apple M1
@stale
Copy link

stale bot commented Apr 28, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 28, 2022
@jclusso
Copy link

jclusso commented May 23, 2022

@guillerodriguez did you ever figure anything out? We had pages where I18n isn't falling back to using the default translations when they are missing.

@stale stale bot removed the stale label May 23, 2022
@guillerodriguez
Copy link
Contributor Author

guillerodriguez commented Jun 2, 2022 via email

@stale
Copy link

stale bot commented Aug 31, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 31, 2022
@guillerodriguez
Copy link
Contributor Author

Do not close.

@tdreyno tdreyno added notstale and removed stale labels Aug 31, 2022
@markets
Copy link
Member

markets commented Feb 7, 2023

@guillerodriguez is this still valid after latest merged pull requests?

@markets
Copy link
Member

markets commented Feb 15, 2023

hi @guillerodriguez did you have a chance to check it out 🙏🏼? Thank you so much in advance!

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

No branches or pull requests

4 participants