Giter Club home page Giter Club logo

Comments (5)

BudsieBuds avatar BudsieBuds commented on June 12, 2024 1

You're right, I thought I did my research. The default behavior was overwritten. Thanks for your comments!

from codeigniter4.

kenjis avatar kenjis commented on June 12, 2024

You only need to provide values for those messages that would be localized differently for that locale variant. Any missing message definitions will be automatically pulled from the main locale settings.
https://codeigniter4.github.io/CodeIgniter4/outgoing/localization.html#language-fallback

If there is a key in a localized lang file, it will be used.
You set empty strings. So these empty strings are used.
Why is it necessary to fall back?

from codeigniter4.

BudsieBuds avatar BudsieBuds commented on June 12, 2024

The reason for the language files with empty strings is because they're put in a Weblate instance used for community translations. These strings remain empty until they are translated by community members.
In CI3, the system would fall back to English even when the strings were empty. I was expecting the same behavior in CI4, hence I thought it was a bug.

from codeigniter4.

kenjis avatar kenjis commented on June 12, 2024

In CI3, the system would fall back to English even when the strings were empty.

How to reproduce?
It seems there is no Language Fallback in CI3.
https://www.codeigniter.com/userguide3/libraries/language.html

from codeigniter4.

michalsn avatar michalsn commented on June 12, 2024

In CI3, the system would fall back to English even when the strings were empty.

That is not true. The fallback will only occur if the language key in question does not exist.
Another explanation is that you have modified the default behavior in CI3 with the MY_Lang class.

from codeigniter4.

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.