juan
juan

Reputation: 41

how to use i18n for one language cakephp

how do I setup i18n just to translate to spanish? I don't want user to change languages on the app, so I just need users to see the app in spanish...

I think don't need any routing... am I correct?

Upvotes: 2

Views: 778

Answers (1)

deceze
deceze

Reputation: 521995

If your website only has a single language, just write your spanish text directly into your view files where it's needed. No need to double the work.

If you still want to go with English text in the view files and a Spanish .po file, just set up your app according to the documentation and put this in your core.php to fix the language to Spanish:

Configure::write('Config.language', 'es');

In the views:

__('Hi!');

In your translation file:

msgid "Hi!"
msgstr "¡Hola!"

Upvotes: 4

Related Questions