Language FALLBACK not work

46 views
Skip to first unread message

scrazzy

unread,
Apr 20, 2017, 8:40:07 AM4/20/17
to f3-fra...@googlegroups.com
Hi, Im using version 3.6.0 and I cannot change fallback language.

I tried adding this to index.php:

$f3->set('FALLBACK','cs');

$f3
->FALLBACK = "cs";

and even setting it in config file:

FALLBACK = "cs"

But when outputing $f3->LANGUAGE there is always EN as last fallback language. I tried setting fallback to different languages but no change, EN is always fallback.

ved

unread,
Apr 20, 2017, 12:10:04 PM4/20/17
to Fat-Free Framework
I'm not absolutely sure about this but AFAIK:

LANGUAGE has a list of languages that are set on your browser. For example "en_US, en, pt"

That means that F3 will try to load in order the "en_US", then "en" and then "pt" dictionaries.

Only if none of those dict files exit, it will then fallback to the defined FALLBACK. I don't think it adds the fallback to the end of the LANGUAGES list.

I'm hoping somebody from the dev team can confirm if I'm wrong about this or if this is indeed the case.

Other than not seeing your "cs" on the LANGUAGE list, is your app actually behaving wrongly? Have you tested with the correct dict files and browser settings?

scrazzy

unread,
Apr 20, 2017, 2:42:57 PM4/20/17
to f3-fra...@googlegroups.com
I have this files in my dict folder:
en.ini
cs.ini

FALLBACK is set to CS

When I have browser set to CS I got CS page
When I have browser set to EN I got EN page
When I have browser set to any other language (PL, SK, etc.) I got EN page (but fallback should go to CS)

-----------------------

Worse situation is when I have only:
cs.ini

FALLBACK to CS

When I have browser set to CS I got CS page
When I have any other language I got EMPTY PAGE WITHOUT MESSAGES (no keys translated)

This effectively prevents me from using auto language feature, because Im unable to use EN.INI as this have to be filled with CS translations.

ved

unread,
Apr 20, 2017, 4:33:12 PM4/20/17
to Fat-Free Framework
Humm I see.. So this is probably not related to what I posted.

So, again without being 100% sure about this:

I saw that "cs" isn't a part of F3's ISO class (although I'm not sure if that class is even used when selecting a display language).

I also found out that "cs" (serbia montenegro?) doesn't belong in the ISO 3166-1 standard  (that F3's ISO class adheres to) but only belonged (note past tense) to ISO 3166-2.
See the links or this snippet entry from the wikipedia entry:

Serbia and Montenegro was officially assigned the ISO 3166-1 alpha-2 code CS before it was dissolved in 2006, and the entry was deleted from ISO 3166-2 as a result. The two republics, Montenegro (SerbianCrna Gora) and Serbia (SerbianSrbija), became independent and are now officially assigned the ISO 3166-1 alpha-2 codes ME and RS respectively.

So, can you try your setup using "me" or "rs" as applicable and let us know the results?


 

bcosca

unread,
Apr 20, 2017, 5:33:30 PM4/20/17
to Fat-Free Framework
Please check if commit  399ac2e in fatfree-core addresses your issue.

scrazzy

unread,
Apr 21, 2017, 3:29:40 AM4/21/17
to Fat-Free Framework
Yes, it's fixed with given commit. Thank you!
Reply all
Reply to author
Forward
0 new messages