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

effective locale set, not only language, in setupLocale() #90

Closed
xho opened this issue Sep 5, 2012 · 4 comments
Closed

effective locale set, not only language, in setupLocale() #90

xho opened this issue Sep 5, 2012 · 4 comments

Comments

@xho
Copy link
Member

xho commented Sep 5, 2012

In frontend_controller, riga 72, c' il metodo setuplocale che cambia la lingua corrente e imposta cookie, sessione, etc...

Con il cambio della lingua bisognerebbe chiamare anche la funzione PHP setLocale, per avere date, monete, comparazione di stringhe, ecc. concordi.

Siccome un locale pu non essere disponibile, oppure avere nomi diversi, si pu sfruttare la possibilit di passare un array ordinato come secondo argomento di setLocale per assegnare il primo disponibile. Per esempio per il tedesco:

$currentLocale = setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');

La funzione restituisce il locale utilizzato.[[BR]]
Pe resettare il locale e sapere anche quale disponibile di default:

$currentLocale = setlocale(LC_ALL, 0) 

Come riferimento sui codici lingua in generale, guardare all'[http://www.loc.gov/standards/iso639-2/langhome.html ISO639 (rev2)] e l'[http://www.faqs.org/rfcs/rfc1766 RFC1766].

@ghost ghost assigned d3v3d3 Sep 5, 2012
@xho xho closed this as completed Sep 5, 2012
@stefanorosanelli
Copy link
Member

todo:

  • put in bedita.sys.php - locales are sys dependent
$config["beditaLocales"] = array(
 "ita" => array("it_IT.utf8", ...)
 "eng" => array("")
  ...
)
  • if $currLang in $config["beditaLocales"] ==> setLocale

@stefanorosanelli
Copy link
Member

same setLocale in backend and frontend

@stefanorosanelli
Copy link
Member

6bd6601

in bedita.sys.php put

 $config["locales"] = array(
 "ita" => array("it_IT.utf8", ...)
 "eng" => array("en_US.utf8")
  ...
)

in the view $currLocale displays current locale

@stefanorosanelli
Copy link
Member

(In dda0065) locales.php loaded from bedita.ini, override in bedita.cfg if needed - see #90

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

No branches or pull requests

3 participants