Web aplikacije, web servisi i software Frameworks, web servisi, programi, plugin-ovi, ekstenzije korisni za razvoj web sajtova. Sponzor:
![]() |
![]() |
|
Alati teme | Način prikaza |
![]() |
#11 | |
član
Certified
|
![]() Citat:
'sr' je ono sto vecina (ako ne i svi) salju kao Accept-Language header kada su podeseni za nas jezik. |
|
![]() |
![]() |
![]() |
#12 |
Python Ambassador
Master
|
![]() @andrej: "cs" locale ti ništa ne znači, jer IMHO većina browsera danas šalje sr, tj. ako je uopšte "svesna" Srpskog.
PS: Sad sam video kako IE rešava problem latinice i ćirilice... Originalno nema šta ![]()
__________________
Python Ambassador of Serbia |
![]() |
![]() |
![]() |
#13 | |
član
Certified
|
![]() Citat:
![]() A sta salje u Accept-Language, kada je tako namesten? |
|
![]() |
![]() |
![]() |
#14 |
Python Ambassador
Master
|
![]() Funny you should ask:
Kôd:
HTTP_ACCEPT_LANGUAGE: sr,sr;q=0.5 ![]()
__________________
Python Ambassador of Serbia |
![]() |
![]() |
![]() |
#15 | |
član
Certified
|
![]() Citat:
![]() ![]() ix, konacno neka korist od IE p.s. mogao sam i da pretpostavim. Odvikao sam se od win*sa (srecom) |
|
![]() |
![]() |
![]() |
#16 |
član
Certified
|
![]() Xex, ko ne gleda ...
Našao sam (gledajuci python locale source) jasnu referencu za celu ovu pricu na RFC 1766. Za one koje mrzi da citaju (ukljucujuci i mene) izdvajam: Kôd:
In the first subtag: - All 2-letter codes are interpreted as ISO 3166 alpha-2 country codes denoting the area in which the language is used. - Codes of 3 to 8 letters may be registered with the IANA by anyone who feels a need for it, according to the rules in chapter 5 of this document. The information in the subtag may for instance be: - Country identification, such as en-US (this usage is described in ISO 639) - Dialect or variant information, such as no-nynorsk or en- cockney - Languages not listed in ISO 639 that are not variants of any listed language, which can be registered with the i- prefix, such as i-cherokee - Script variations, such as az-arabic and az-cyrillic In the second and subsequent subtag, any value can be registered. Kôd:
sr-latin sr-cyrillic Kôd:
sr-yu-latin sr-yu-cyrillic |
![]() |
![]() |
![]() |
#17 | |
član
Certified
|
![]() Citat:
Kôd:
In the primary language tag: - All 2-letter tags are interpreted according to ISO standard 639, "Code for the representation of names of languages" [ISO 639]. - The value "i" is reserved for IANA-defined registrations - The value "x" is reserved for private use. Subtags of "x" will not be registered by the IANA. - Other values cannot be assigned except by updating this standard. Pocetni kod je kod jezika a ne zemlje. IMO, cela prica o lokalizaciji je vezana za jezik a ne za lokaciju (iako subtag dozvoljava odvajanje po tome npr. en-gb i sl), tako da locale za srpski jezik nikako ne moze da spada pod cs (ma kako nas "skratili"). Poslednja izmena od nesh : 11. 10. 2005. u 22:14. |
|
![]() |
![]() |
![]() |
#18 |
Python Ambassador
Master
|
![]() Dobro nesh, koju ćemo varijantu koristiti
Kôd:
(sr_CYR, sr_LAT) ili (sr-latin, sr-cyrillic)
__________________
Python Ambassador of Serbia |
![]() |
![]() |
![]() |
#19 | |
član
Certified
|
![]() Citat:
Za ostalo, ...., ako je vec definisano u RFC-u valjda bi trebalo da poslusamo ![]() Kôd:
>>> from gettext import _expand_lang >>> _expand_lang('sr') ['sr'] >>> _expand_lang('sr-latin') ['sr-latin'] >>> _expand_lang('en') ['en_US.ISO8859-1', 'en_US', 'en.ISO8859-1', 'en'] >>> _expand_lang('sr@Latin') ['sr@Latin', 'sr'] >>> _expand_lang('sr-cyrillic') ['sr-cyrillic'] >>> _expand_lang('sr@Cyrillic') ['sr@Cyrillic', 'sr'] >>> _expand_lang('sr_latin') ['sr_latin', 'sr'] >>> _expand_lang('sr_cyrillic') ['sr_cyrillic', 'sr'] ![]() Posto gettext koristi ovo kao ulaz za pravljenje imena fajla koji trazi izgleda da je najjednostavnije da se uradi nesto tipa locale.replace('-', '_') prilikom parsovanje Accept-Language headera da bi se ispostovao RFC. Javi cu se kada prespavam ![]() |
|
![]() |
![]() |
![]() |
#20 |
Python Ambassador
Master
|
![]() 1. Na koji si tačno način mislio da izvedemo on-the-fly konverziju u latinicu?
2. Gde bi čuvao/keširao lokalizacije? Mislim da bismo opet onda imali problema sa cache frameworkom - osim ako, naravno, ne koristiš kolače, koje korisnici "dijabetičari" ne vole. offtopic: Doneću računar za vikend u NS, tako daćemo manje da smaramo sve vas ovde na forumu ![]()
__________________
Python Ambassador of Serbia |
![]() |
![]() |
![]() |
Alati teme | |
Način prikaza | |
|
|
![]() |
||||
Tema | Početna poruka teme | Forum | Odgovori | Poslednja poruka |
Language recognition | treety | Linkovi | 0 | 06. 05. 2009. 00:59 |
Novi IBAN kodovi za Srbiju | Gruja | e-Business | 5 | 19. 04. 2007. 18:26 |
What does the hot girl at the party think of your programming language? | dinke | Opušteno | 0 | 23. 03. 2007. 20:31 |
Select language ... | Ivan | Opušteno | 32 | 22. 12. 2006. 13:40 |