Code Monkey home page Code Monkey logo

Comments (5)

MichaelHoste avatar MichaelHoste commented on September 13, 2024 1

That should have been recently fixed. Thanks for the feedback!

from rails.

MichaelHoste avatar MichaelHoste commented on September 13, 2024

Hi @ChillyFlashER,

I don't understand the issue.

Are you talking about the top element in the YAML file? Which on, translation.*.yml or localization.*.yml?

The top element should be the same as the languages you defined in the config/translation.rb file.

Could you be more specific about your issue and paste some snipped of your configuration and problematic YAML files?

(Sorry for the delay, I'll try to be more reactive from now)

from rails.

erictuvesson avatar erictuvesson commented on September 13, 2024

Hi,

When we first setup new languages the top element in the YAML file the header didn't match the language code.

This was a while ago and I haven't tried it again. It might just have been something to do with our first setup that went wrong or something similar.

So when we generated new files for languages like da-DK it produced a file like this.

## Source: config/locales/localization.da-DK.yml
# THIS FILE CONTAINS LOCALIZATION KEYS : date and number formats, number precisions,
# number separators and all non-textual values depending on the language.
# These values must not reach the translator, so they are separated in this file.
#
# More info here: https://translation.io/blog/gettext-is-better-than-rails-i18n#localization
#
# You can edit and/or add new localization keys here, they won't be touched by Translation.io.
#
# If you want to add a new localization key prefix, use the option described here:
# https://github.com/aurels/translation-gem#custom-localization-key-prefixes
#
---
da:
  ...

And the gem was looking for da-DK so it couldn't find the translations, we fixed it by manually changing all the keys of languages that has a dash in it.

from rails.

MichaelHoste avatar MichaelHoste commented on September 13, 2024

Thanks @ChillyFlashER,

I understood the issue, I'll try to reproduce this error but it seems weird, it should definitely work as expected.

I'll keep you in touch.

from rails.

MichaelHoste avatar MichaelHoste commented on September 13, 2024

I can confirm that you are absolutely right. It only impacts localization.xx.yml files (not translation.xx.yml files).

It still works quite good since "de-DE" fallbacks to "de" and "da-DK" fallbacks to "da". But I need to fix this. Thanks a lot!

from rails.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.