Posts Tagged ‘i18n’

I18N Suggested Naming Conventions

December 19th, 2009

Prefixes

G_ For profile titles. Taken from the Google Optimization.
A_ Text for links. Remember “A” from Anchor tag,
M_ Messages
B_ Buttons’ name like sumbit, save etc.
L_ Labels: Generally will appear near the inputs controls. Like Nickname, etc.
E_ Error messages

H_ titles (Headings like stuff)
I_ Items. Preferable one or two words that don’t fit in the other categories.
N_ For emails. Taken from the german Nachricht.
T_ Text. More than one sentence (Paragraph).
S_ Sentences, like Wer ist online, etc.

Use Gamble Hints as a memory helper.

Some Suggestions:

Let’s say there is a successfully uploaded image, so will do like this:

M_IMAGE_SUCCESSFULLY_UPLOADED.

NOTE: The spaces between words are replaced by underscores.

How to deal with variables.

Let’s say we want to show this message:

<?php echo 'The message to ' . $username . 'was successfully delivered'; ?>

So, we will do something like this:

__('M_MESSAGE_SUCCESSFULLY_DELIVERED_TO_%username%', array('%username%' => $username))

Then the translator will insert this text on the Translation admin page.

ES: 'El mensaje para %username% fue enviado correctamente'
FR: 'Le message à% username% a été envoyée avec succès'
RN: 'Ubutumwa bya %username% byarungitswe'
ZH: '给%username%发送信息成功'