Dictionary issue

34 views
Skip to first unread message

meow

unread,
Dec 19, 2017, 2:57:06 PM12/19/17
to Fat-Free Framework
I cannot for the life of me get dictionary files working in f3, I read the docs and found some samples on other sites but no luck.
I tried both using en.php and en.ini methods to no avail. According to everything I've read and examples I followed, this should work...

layout of the app

index.php
-- app/config/setup.cfg
-- app/config/routes.cfg
-- app/dict/en.php
-- app/dict/fr.php
-- app/views/home.php
-- app/controllers/homectrl.php

setup.cfg sample
PREFIX=DICT
LOCALES=app/dict/
LANGUAGE=en

en.php sample
<?PHP
return array(
    'menu_home'=>'Home',
    'menu_language'=>'Français',
    'menu_options'=>'Options',
    'menu_other'=>'Other Stuff'
);

home.php template sample
<div>{{ @DICT.menu_home }}</div>

xfra35

unread,
Dec 19, 2017, 3:09:37 PM12/19/17
to Fat-Free Framework
Beware of PREFIX:

PREFIX Resulting dictionary key

menu_home
dict_ dict_menu_home
DICT. DICT.menu_home
DICT DICTmenu_home

meow

unread,
Dec 19, 2017, 3:11:44 PM12/19/17
to Fat-Free Framework
omg what a simple thing!
thank you so much, I completely missed the period in the example
Reply all
Reply to author
Forward
0 new messages