Gettext i18n system - internationalization for gettext

9
https://lingohub.com MADE WITH BY LINGOHUB INTERNATIONALIZATION FOR GETTEXT GETTEXT i18n SYSTEM

Transcript of Gettext i18n system - internationalization for gettext

https://lingohub.com MADE WITH BY LINGOHUB

INTERNATIONALIZATION FOR GETTEXT

GETTEXT i18n SYSTEM

GETTEXT i18n SYSTEM

− Gettext has implementation in almost any programming language

− “The grandfather” of all i18n resource files

− You’ll find a library for using gettext in your application for almost any programming language

− Gettext can be a great choice if you are forced to use different i18n systems and to replace it

with a pervasive solution

https://lingohub.com MADE WITH BY LINGOHUB

⟶ With a tool like LingoHub resource files and syntax won’t matter anymore. LingoHub

supports various resource files and their syntax.

GETTEXT i18n SYSTEM

Gettext offers features your standard system might be missing:

− Pluralization support

− Enumerations

− Different types of comments

− Different types of flags for every segment

https://lingohub.com MADE WITH BY LINGOHUB

GETTEXT RESOURCE FILE FORMATS AND GETTEXT i18n

PO (Portable Objects)

− .po files represent the central file format

for using gettext translation

− The files are human readable and

editable text files

− You can split up PO files for different

categorizations

https://lingohub.com MADE WITH BY LINGOHUB

Example PO file

⟶ Read a detailed format description about PHP internationalization with gettext tutorial on LingoHub!

GETTEXT RESOURCE FILE FORMATS AND GETTEXT i18n

PO (Portable Objects)

− Using LingoHub you don’t have to pass your PO files on to your translator.

− Translators don’t have to edit the files. Your files need to be machine readable and follow

a strong syntax

− The file won’t be readable by the gettext system if the person editing the file forgets

about a quote or uses characters not allowed by the used character set.

https://lingohub.com MADE WITH BY LINGOHUB

⟶ LingoHub checks the validity of files at import. Translators use the LingoHub editor for translations. They no longer have to deal with the syntax of PO files. After finishing translations you can export syntactically correct PO files.

GETTEXT RESOURCE FILE FORMATS AND GETTEXT i18n

POT (Portable Object Templates)

− POT have the same structure as PO files, they just contain the keys (“msgid”) of your

translatable content

− Use POT files if you have chosen the strategy that your keys hold texts of your source

language (instead of generic keys)

https://lingohub.com MADE WITH BY LINGOHUB

GETTEXT RESOURCE FILE FORMATS AND GETTEXT i18n

POT (Portable Object Templates)

Workflow using POT files for translations

1. POT files are created by extracting translatable strings

form your source code or CMS.

2. You pass the POT files on to your translators.

3. Your translators import the files into their CAT tool.

4. After translations are finished, translators will create PO

files and send them back.

Workflow using POT files with LingoHub

− LingoHub allows you to import POT files and export

corresponding PO files. That’s great for starting a

translation project.

− LingoHub offers a feature called Continuous Translation. If

you export-adapt-import your resource files, LingoHub will

detect changes automatically and keep the project in-sync

to your resource files.

https://lingohub.com MADE WITH BY LINGOHUB

GETTEXT RESOURCE FILE FORMATS AND GETTEXT i18n

MO (Machine Objects)

− MO files are machine readable representations of PO files.

− They are smaller in size and valid after creation.

− Using an invalid PO file might break your application. You won’t be able to create an MO

file if the source PO file is incorrect.

− The easiest way to create a MO file is:

https://lingohub.com MADE WITH BY LINGOHUB

msgfmt en.po –o  en.mo

BROUGHT TO YOU BY LINGOHUB

ANJA OBERMÜLLERBUSINESS DEVELOPMENT & MARKETING AT LINGOHUB

[email protected]@LingoHub@anjaobermuellerRead the whole article.

https://lingohub.com MADE WITH BY LINGOHUB