php - Are there cons of my technique for designing multilingual websites -


I am preparing a multilingual website and it is both ltr and rtl .

  1. Language:

    I store languages ​​in arrays like this, such as $ lan = array ('browse' = & gt; 'Ø ØμÙ? Ø', 'plus' = & gt; 'Ø ¥ ØØØ§Ù ?? Ø ·', signin '=>' تسج ?? Ù ?? Ø Ø Ø ¯ Ù Ù Ù? ? '); and saved them in different php files and I include the selected language I want it to be HTML code such as & lt ;? Php echo $ lan ['browse'] ;? & Gt;

  2. Use in direction:

    Most directional issues can be sorted by CSS property dir is. However, sometimes you need to specify different attributes for different directions. Therefore, I have given the body a class name which is "rtl" or "ltr" and then I use it as:

      .brs_search_box {display: inline-block ; Width: 199px; Border: 1 px solid # d3d3d3; Height: 500px; } .rtl .brs_search_box {boundary-left: 0; } .ltr .brs_search_box {border-right: 0; }     

    Is it bad for this technique? For example, would the size of the large size be of no consequence?

    Only problems you can get if you have not explicitly translated every part of the text That is what you resonate.

    For example you $ lcho [*] this text is ''; but what if you have not translated this text yet? This will display the screen blank on the screen if you have not set some type of fallback to use the default text.

    The best sytems for PHP multilingual sites I've used are Gettext and you can see it in the PHP manual at the following link:

    When do I accept that when I first started using it it was not so easy to set up and you need some extra tool to get it, but once you've learned it and Set it up It works very well in my opinion and you Area will have a new string to your bow for future production.

    You basically wrap all your text in the __ () function, for example __ ('this is some text') and then Finds your translation files and displays relevant text

    It separates everything into separate files, which you can use to easily translate the text.

    In addition, if it does not get a translated string for your specification, then it is also useful for handing over the cats to the neighboring neighbors neighbors / friends / neighbors. The text will then only output it as it is provided inside the __ () function.

    It scales a lot to add new languages ​​over time.

    I think there are other options available to you and your work, but it is acceptable for an industry, it would be nice to see the scalable approach gettext .

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -