WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Translating plugins. Gettext. Po-files. (6 posts)

  1. LostInNetwork
    Member
    Posted 7 years ago #

    Hi

    Plugin translation issue, gettext, character sets

    I need to translate a plugin, that has a lot of .po and .mo files in a directory called gettext. There also a .pot file. I have now translated everything (written a translation in msgstr for each msgid). Next I would need to create those .mo files. How do I do this?

    When I run xgettext ec3-fi_FI.po, I get error messages: "invalid multibyte sequence" for each and every "national character".

    What now? What is that .pot file? Do I need it for something? How do I make these national characters "not invalid"?

    I don't know what character sets my web hotel (Debian) or my OS (Windows Vista/Ubuntu) uses. The characters show correctly in vi, gedit, notepad.

    This has something to do with ISO-8859-1 and UTF-8

  2. moshu
    Member
    Posted 7 years ago #

    Always use utf-8, since that is the default encoding in WordPress and is godd for any language.

    Regarding the pot file, the po and mo files + translation tools, se the Codex:
    http://codex.wordpress.org/Translating_WordPress
    (the technology is the same whether it's the whole WP or a theme or a plugin)

    Some more info from one of the devs: http://boren.nu/archives/2004/11/01/localizing-plugins-and-themes/

  3. LostInNetwork
    Member
    Posted 7 years ago #

    Problem solved.

    PROBLEM

    I tried to edit the po-files with visual editor (vi) in a SSH session. Bad choice.

    The remote system with the po-files and the vi editor was running Debian (probably UTF-8, but how could I know...)(no xgettext there, and no root/install access).

    The local system had Windows Vista, and Putty was set to interpret characters as ISO-8859-1, if I remember it correctly. I at all looked good. Looked... There was some character set matching problem that my fine editors and terminals did not show...

    This resulted in text files with "invalid multibyte sequence" (all the national, non-ascii, characters). I downloaded these po-files to Windows (poEdit could not convert them to Unicode) and to Ubuntu (invalid multibyte sequence).

    SOLUTION

    I gave up using vi, and loaded the pot to Windows and ran poEdit. Success.

  4. LostInNetwork
    Member
    Posted 7 years ago #

    It is highly annoying though, that I do not know what the problem actually was.

    I fear that some day I notice that - oops - I have ten megabytes of text in the wrong character set...

  5. LostInNetwork
    Member
    Posted 7 years ago #

    (edited)

    Oh no. The plugin is gone.

    I uploaded my ec3-fi_FI.mo to that ec3 plugins gettext directory. I then created a wordpress/languages directory and copied the mo there (needed?) and changed the wp-settings.php (WPLANG to fi_FI).

    The plugins backend is now properly translated, but the widget is gone from the sidebar...

  6. LostInNetwork
    Member
    Posted 7 years ago #

    Ok, so I translated the names of the event calendar widgets... I had to go to Presentation --> Sidebar Widgets and drag the calendar and event list back to the sidebar.

    Works nicely.

    Now I can see how studip the translation looks... need to fine tune...

Topic Closed

This topic has been closed to new replies.

About this Topic