Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I suggest you not to invent a wheel and use gettext and ISO languages abbrevs list. Have you seen how i18n/l10n implemented in popular CMSes or frameworks? </p> <p>Using gettext you will have a powerful tool where many of cases is already implemented like plural forms of numbers. In english you have only 2 options: singular and plural. But in Russian for example there are 3 forms and its not as simple as in english.</p> <p>Also many translators already have experience to work with gettext.</p> <p>Take a look to <a href="http://book.cakephp.org/2.0/en/core-libraries/internationalization-and-localization.html" rel="noreferrer">CakePHP</a> or <a href="https://drupal.org/project/i18n" rel="noreferrer">Drupal</a> . Both multilingual enabled. CakePHP as example of interface localization and Drupal as example of content translation.</p> <p>For l10n using database isn't the case at all. It will be tons on queries. Standard approach is to get all l10n data in memory in early stage (or during first call to i10n function if you prefer lazy loading). It can be reading from .po file or from DB all data at once. And than just read requested strings from array.</p> <p>If you need to implement online tool to translate interface you can have all that data in DB but than still save all data to file to work with it. To reduce amount of data in memory you can split all your translated messages/strings into groups and than load only that groups you need if it will be possible.</p> <p>So you totally right in your #3. With one exception: usually it is one big file not a per-controller file or so. Because it is best for performance to open one file. You probably know that some highloaded web apps compiles all PHP code in one file to avoid file operations when include/require called.</p> <p>About URLs. <a href="https://support.google.com/webmasters/answer/182192?hl=en" rel="noreferrer">Google indirectly suggest</a> to use translation: </p> <blockquote> <p>to clearly indicate French content: <a href="http://example.ca/fr/v%C3%A9lo-de-montagne.html" rel="noreferrer">http://example.ca/fr/vélo-de-montagne.html</a></p> </blockquote> <p>Also i think you need to redirect user to default language prefix e.g. <a href="http://examlpe.com/about-us" rel="noreferrer">http://examlpe.com/about-us</a> will redirects to <a href="http://examlpe.com/en/about-us" rel="noreferrer">http://examlpe.com/en/about-us</a> But if your site use only one language so you don't need prefixes at all.</p> <p>Check out: <a href="http://www.audiomicro.com/trailer-hit-impact-psychodrama-sound-effects-836925" rel="noreferrer">http://www.audiomicro.com/trailer-hit-impact-psychodrama-sound-effects-836925</a> <a href="http://nl.audiomicro.com/aanhangwagen-hit-effect-psychodrama-geluidseffecten-836925" rel="noreferrer">http://nl.audiomicro.com/aanhangwagen-hit-effect-psychodrama-geluidseffecten-836925</a> <a href="http://de.audiomicro.com/anhanger-hit-auswirkungen-psychodrama-sound-effekte-836925" rel="noreferrer">http://de.audiomicro.com/anhanger-hit-auswirkungen-psychodrama-sound-effekte-836925</a></p> <p>Translating content is more difficult task. I think it will be some differences with different types of content e.g. articles, menu items etc. But in #4 you're in the right way. Take a look in Drupal to have more ideas. It have clear enough DB schema and good enough interface for translating. Like you creating article and select language for it. And than you can later translate it to other languages.</p> <p><img src="https://i.stack.imgur.com/uBQKy.png" alt="Drupal translation interface"></p> <p>I think it isn't problem with URL slugs. You can just create separate table for slugs and it will be right decision. Also using right indexes it isn't problem to query table even with huge amount of data. And it wasn't full text search but string match if will use varchar data type for slug and you can have an index on that field too.</p> <p>PS Sorry, my English is far from perfect though.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload