WordPress.org

Ready to get started?Download WordPress

Forums

how to make a localization work? (11 posts)

  1. psicotico
    Member
    Posted 10 years ago #

    Hi!
    I have done a localization file on pt_PT.po and produced a pt_PT.mo.
    I would like to test this translation on my site to cheack for errors. On wiki it written:
    iThe MO is the end of the line. The MO provides full support for a given language. To install French language support, a user would place fr.mo into the wp-includes/languages directory of his WordPress installation.\i
    But i can´t make it work. Created a wp-includes/languages/ and upload pt_PT.mo there, but i miss what makes it work. Do i have to do a clean install, or can i mess up config-php?

  2. ihad
    Member
    Posted 10 years ago #

    also add the line:
    ´define('WPLANG', 'pt_PT.mo');´
    to your wp-config.php file.
    ai

  3. Xavier Borderie
    Member
    Posted 10 years ago #

    I just updated the wiki accordingly.
    I think every .po page should feature an explanation on how to do it, or some kind of documentation. fr.po and es_ES.po already do.

  4. psicotico
    Member
    Posted 10 years ago #

    Changed to ´define('WPLANG', 'pt_PT.mo');´ as sugested but
    I´ve got
    Parse error: parse error in /home/XalteredX/XalteredX/teste/wp-config.php on line 8
    l10n.php shouldn´t be change too?
    the file pt_PT.mo seam ok and is on /wp-includes/languages/

  5. psicotico
    Member
    Posted 10 years ago #

    Didn´t use the apostrophes, it was a dumb way to show code.
    Still i get:
    Parse error: parse error in /home/psico13/public_html/teste/wp-config.php on line 8
    Please confirm this :
    define('WPLANG', 'pt_PT.mo')
    or
    define('WPLANG', 'pt_PT')
    on the spanish http://wiki.wordpress.org/es_ES.po
    is writting :
    define ('WPLANG', 'es_ES');
    (no .mo extention)
    I´m getting a little confused!

  6. Xavier Borderie
    Member
    Posted 10 years ago #

    I didn't notice the mistake : don't put ".mo" in the define.
    define('WPLANG', 'pt_PT') is the way to go.

  7. ihad
    Member
    Posted 10 years ago #

    is line 8 in your wp-config.php the line of the define(... statement?
    and did you end the line with a ; (semicolon), seeing as you pasted the define in here without semicolon.
    wp-110n.php adds the ".mo" (as you can check in the source code) so you must not include it in the define statement.

  8. psicotico
    Member
    Posted 10 years ago #

    Great !
    Sorry it was a space produced by my nasty text pad. Working now, but i have this big bug on localization!
    The english calender output
    S M T W T F S
    So ther are two T (Tuesday Thursday) and two S (Saturday Sunday), and can be ignore
    But in portuguese (and i belive other languages)
    Dom Seg Ter Qua Qui Sex Sab
    Should be:
    D S T Q Q S S
    NOT
    D S T Q T S D
    So don´t make 2 T not 2 S !

  9. psicotico
    Member
    Posted 10 years ago #

    Sorry forgot the URI for tests
    http://www.psicotico.com/blog/

  10. Ryan Boren
    WordPress Dev
    Posted 10 years ago #

    psicotico, the calendar issue is a bug. You can use the three letter abbreviations instead by calling get_calendar() with a numeric argument.
    get_calendar(3);
    BTW, anyone know of a good multi-byte string library written in pure PHP and licensed under the GPL? That's what we really need to fix this.

  11. Xavier Borderie
    Member
    Posted 10 years ago #

    rboren : I'm sure you're already aware of this, but I'm still gonna say it : the main problem is not with the number of letters used in the abbreviations, but the fact that two days are duplicates of two other days, which makes the calendar unusable to other language.
    Other language also use the same letter for some days, but not the same day as english. Here's how it should display (as best as I could understand - let me know if I made a mistake):
    uk : S M T T F W S (1st day of week is sunday)
    fr : L M M J V S D (1st day of week is monday/lundi)
    pt : D S T Q Q S S (1st = sunday/domingo)
    it : L M M G V S D (1st = monday/lunedì)
    de : M D M D F S S (1st = monday/montag)
    ect.
    ...which is still understandable (for these languages, I understand others DO need more than one letter).
    The first problem to solve (and I guess it already is, or is in the works - again, I'm not trying to tell you what should be done rboren, as I'm sure you're already aware of these issues)... erm, the first blablabla solve is the "first day of the week" issue. Combine this problem with what other languages see in WP and you get this kind of calendar (again, let me know if I made a mistake) :
    uk : S M T W T F S
    fr : D L M M M V D
    pt : D S T Q T S D
    it : D L M M M V D
    de : S M D M D F S
    ect.
    Hard to tell what's what. If you'd ask me : too many M & S :)
    I'm writing this as some kind of reference, hopefully that will be helpful to someone... I'm going to add a Known Bugs section in fr.po, so that no one gets a surprise...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.