Translation Process

Translations of Suffusion into other languages. This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.
Forum rules
This forum is closed with effect from February 2019. Please post future requests on https://github.com/sayontan/suffusion.
Locked
sayontan
Site Admin
Posts: 10210
Joined: 15 Sep 2009, 16:39
Location: Houston, Texas
Contact:

Translation Process

Post by sayontan » 04 Nov 2009, 17:53

Note that I am not an expert in this area. So what follows is merely my approach towards making my theme translation-ready and bundling available translations with it.

To begin with, these are the tools I use:
  1. A PO file generator - I use the one here. I zip my entire theme directory and upload it to this site (where it asks me to load the PHP file). It automatically generates the PO (Portable Object) file for me. I copy out the PO file, then store it as "suffusion.po". This is the generic file that is used. Since all my content is in English I simply copy this file out to en_US.po. Note that a block of code in the default PO file looks like this:

    Code: Select all

    #. Text in function
    #: suffusion/comments.php:35
    #: suffusion/functions/actions.php:817
    msgid "% Responses"
    msgstr ""
    
    The lines suffusion/comments.php:35 and suffusion/functions/actions.php:817 indicate the lines in the files comments.php and actions.php where the translatable string "% Responses" occurs.
  2. POEdit - As the name suggests, this is the PO file editor. I can copy the generated PO file from the previous step to say fr_FR.po, which will have the French translation. Once I have a this PO file created I open it in POEdit, then for each string that shows up in the PO file I put in the French translation. Once my file is ready, I save it. If you open the file in a text editor after the save, you will see lines like this:

    Code: Select all

    #. Text in function
    #: suffusion/comments.php:35
    #: suffusion/functions/actions.php:817
    msgid "% Responses"
    msgstr "% Réponses"
    
    Note that in your text editor Réponses may show up as Réponses. Saving automatically generates the MO (Machine Object) file. For each PO file I will have a corresponding MO file.
  3. WinMerge - This is the tool I use to keep my files in sync. Since this is a live theme with live translations, at the time of each release I first generate the suffusion.po file, then compare it line by line with the individual language PO files. In case there is a discrepancy in the line information I update the language file with the new line. E.g. if "% Responses" appears in line 37 of comments.php in the new suffusion.po file, WinMerge lets me update this line in fr_FR.po. Once all the PO files have their line information synced up I open each of the PO files and save them all to generate the MO files.
That's it - I bundle the theme together and release it.

Locked