Skip to content

JSONplus/qTranslate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

qTranslate

$q = new \JSONplus\qTranslate();

Syntax of qTranslate texts

A translation starts for a section — a block.

[:en]English[:nl]Nederlands[:es]Espagnol[:]

With [:en] you start the English-variant of this block. By [:nl] or [:es] you start the other-language-variants. With [:] the current block will be closed.

This structure provides blocks which are translated, an blocks which are literal.

Added flags can be insert postfixed to the language-code like [:en*~]. Use the flag:

  • * to assign the default language.
  • ! to assign this language to be used in this block. All other language-alternates are being ignored.
  • ? notes this translation is a concept.
  • ~ notes this translation was generated by a tool like Google Translate.

You could also use references for gettext or other ::pointer()-methods by: [#reference] (shortest) or [:][:#]reference[:] (where the [:] can be optional). A reference has to comply to the pattern [a-zA-Z0-9_\-]{1,32}.

History

More then 5 years ago I used an Wordpress-extension for i18n. It was called qTranslate. These days it has become discontinued, even its successors. But I really liked its simplicity, of its syntax. By using [:en]English text[:] or <!--:en-->English text<!--:--> it could denote which blocks are language specific (and having multiple translated blocks) or non-specific.

About

A simple tool to make human-readable texts support multi-lingual blocks.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages