Language string validation

Derek Jones edited this page Jul 5, 2012 · 7 revisions
Clone this wiki locally

When you are developing multi-lingual applications, often it is very hard to track the status of all your language files. After lots of modifications to your code and your views, are all your language files still in sync?

I have developed a small controller that you can drop into the application controllers directory.

You configure the base language (the language to check against) at the top of the controller. By default, this is set to 'english'. You can also define a location for your language files, for example if you want to check module languages. By default, it point to the application folder language directory.

When called, it will check and validate all your language files.

  • do all files in the base directory also exist in all other directories?
  • do they all contain the same language strings?

Missing files, or missing language strings (keys) in a file are reported.

The controller can be downloaded from this forum post.

Category:Contributions::Controllers::Language_string_validation