-1

I know that Cakephp can do i18n localization with the .pot files and the various language po files, with __("string"); on the view files.

However, I am trying to export data in csv through the use of the Shell. May I know how is it possible to deploy i18n that into the shell and task files to manipulate data translation?

Thank you very much.

jl.
  • 2,209
  • 12
  • 49
  • 61

1 Answers1

1

Be sure to set the right locale and language before doing so. Remember that the shell tasks will not perform the logic that is handled in locations like AppController::beforeFilter(), so if that is the location that you normally set your language/locale, it won't be set in the shell task.

Also, if you rely on 'auto' detecting the locale from the browser accept-language, this will obviously not work :)

Also you need to have the locales you wish to use installed on the server side so based on the server you're using you will have to make the appropriate checks to verify that indeed this locale(s) is(are) present on your server/machine that is running the Shell(s).

The regular function __() should also work inside the Shell

Rudi Visser
  • 21,350
  • 5
  • 71
  • 97
thaJeztah
  • 27,738
  • 9
  • 73
  • 92