Switch between different languages interface in cakePhp - cakephp

I am learning the locale function in Cakephp.
I am not sure how to design my own locale files so that
users can switch between Spanish and English in my web sites.
Please advise.

The first place I'd go is here, http://book.cakephp.org/view/162/Internationalizing-Your-Application
I've not tried this before, as the project I was working on, English and Swedish, someone had already done the setup.
From what I understand you can manage the language in your routes, to have example.com/en/ or example.com/se then your other routes, and that will load up the correct language translations.
As I understand it there are multiple methods for managing how you switch the language from routes to sessions.

Related

Which one should be used in React, l10n or i18n?

I have a webpage in React and I wanted to use l10n (localization) but only find information about i18n (internationalization), so I don't know if l10n exists for React or if I'm forced to use i18n.
l10n stands for localization and i18n stands for internationalization.
Localization is the process of guaranteeing your resources are focused on the requirements of one specific audience.
The use of it is about adapting your entire content so that it meets the norms and expectations of a specific location or market.
To know more about localization, have a look at this blog post.
The internationalization process covers the design and development. So basically it is the task of instrumentalization (adaption) of your software code to be ready to be localized (not only translated) for other languages, regions and cultures. Think about ltr or rtl, currencies, date formats, etc...
Usually an i18n framework is used to help with this tasks.
Since you're talking about React.js, you may have a look at this step by step guide for react-i18next.
To know more about internationalization, have a look at this blog post.
There is also globalization, for that have a look at this.
So tldr; There's a lot to think about when internationalizing a webpage.
More information can be found here:
What is Software Localization
Is your software ready for localization?
How to localize your website

I18n Internalization in react for english and hindi

I am building a single page application using React. I want my website to be available in both the hindi and english language. So, for that I think I have to use react-intl. Okay but how can I make this work? I read a few tutorial but I did not find any good solution for Hindi. Please help me in my research on how to use i18n for English to Hindi.
It seems that Hindi language uses Devanagari script which is written from left to right (LTR), so translating your site to Hindi isn't different from translating it to any other language (e.g. Frech, Spanish, Czech).
All you need to do is add react-intl components to your code, create a message catalog with messages, translate it into Hindi and load it into your app.
If you have a more specific problem, please update your question or post another one.
Also, I'm an author of lingui i18n library which you might consider if you're at the beginning of your project. It's successor to react-intl and very similar in usage. There's a tutorial, but I could help you with any problems you might have with a Hindi.

how to add multiple languages to an English website

I am trying to add two additional languages to my website - Chinese, Japanese. User inputs could be in native language, in English or be mixed. E.g. search by product name. Likewise output can be all-English or be in mixed languages, depending on a user's preferences. I already have applicable translations so that is not a problem. It is a data intensive site. It uses web APIs to fetch JSON data objects, and uses angular and backbone, and jquery.
I will appreciate if you possibly refer me to some good books or pages that provide guidance for building multilingual sites. Are there any particular web standards that must be followed by websites and by browsers?
Googling yields a ton of links, but the discussion appears centered around specific packages such as wordpress, joomla, .net, drupal, etc. and appears more around automated translations. It still left me confused about the basics requirements of multilingual sites as I do not use any of these packages.
Thanks a lot.
ps: if you need to leave me a -1, np. But I would very much appreciate a comment as to why - so that it doesn't appear as if you just vented and offered me no opportunity for improvement.
Wells... when i need to build a bilingual website i just use a language selector menu and build the whole website in 2 languages (i think this way its more professional) cause usually translators doesnt 100% translate correctly and at the end you just get a bunch of stuff making no sense.
Maybe you could use Google Website Translator gadget for what you trying to do?? its paid service tho, you could use also the plugin for Wordpress http://wordpress.org/plugins/google-language-translator/
Or use the Google Ajax Language API https://code.google.com/p/jquery-translate/

Internationalization and Localization in CakePHP 2.1

I am building a dual language app in CakePHP 2.1.x because of the great reviews of Cake's "built-in" localization features. However, I am wrestling with getting this powerful feature to work.
I know that this topic has been tackled for previous versions of Cake (here, here, here, and here), but it hasn't been solved for Cake 2.x. I am also referencing these articles in the cookbook (yes, I've read the manual):
http://book.cakephp.org/2.0/en/core-libraries/internationalization-and-localization.html
http://book.cakephp.org/2.0/en/core-libraries/behaviors/translate.html
Couple of things -- I do not want to do separate subdomains for each language. Instead, I prefer URL based language switching with the click of a button (in this case, a flag icon). The site will be actively maintained, so the content needs to update dynamically. Asking the client to maintain two separate sites/databases is out of the question.
I have Translate behavior set up for my PostModel, but I can't tell if it's working. I also initialized I18n by running I18n in the console, have confirmed the database tables exist, have set up my .po files, and have wrapped all my content in __(). However, when I change the default language in my browser to French, the site remains in English.
I've tried the P28n Component, but I think it's outdated for Cake 2.x. I also tried URL-based language switching based on this nuts-and-bolts-of-cakephp article, but apparently it's incompatible with the new CakePHP API.
Can anyone point me in the direction of a tutorial or instructions that work with CakePHP 2.x? One not already referenced here?
Update: I found this article: http://www.localizingjapan.com/blog/2011/11/10/localizing-a-cakephp-application/comment-page-1/#comment-7467. Does anyone know where you place the code for CakeSession::write('Config.language', 'fre'); and setlocale("LC_ALL", "fr_FR.utf8");?
Simply put the code in AppController::beforeFilter() and set the values based on however you retrieve the language, from a post request or a part of the URL.

Translate Front-End Site Interface in Drupal 7

I am working on a multi-lingual website in Drupal 7. I installed the i18n module to translate the content on the website. However, I also have other site interface elements on the front-end part of the website like button texts, navigation links, etc that I would like to translate.
Is it really necessary to develop different themes per language? Or is there a more elegant solution to do this?
Thanks!
"Is it really necessary to develop different themes per language?"
No, it isn't. Every visual text can be translated, via the Translate interface-entry in the admin menu. If you write your own modules, templates and stuff, use the t-function to make the terms available in Translate interface or write your own po-files.
There is one issue of course: if the length of the terms in language A is too different to language B you can get in trouble with your layout. So test everything in depth and load different css styles if necessary.

Resources