2

Using Translate Bahavior on CakePHP 1.3 with no records in the i18n table will get non of the content displayed, no matter that there is untranslated record in the main table.

I have found someone that has patched the translate behavior to get the data from the main table if no record in i18n but the first one does not apply to CakePHP 1.3 and can't find the second one which site is offline:

http://codaset.com/robwilkerson/scratchpad/source/master/blob/cakephp/behaviors/translatable.php

How to get the record from main table as fallback if no i18n record is found?

Community
  • 1
  • 1
Constantin.FF
  • 687
  • 1
  • 10
  • 23

1 Answers1

2

How exactly are you applying i18n? If you just use the __() wrapper, it should return whatever is inside if it can't find a translation. Like it says in the book:

The __() function will translate the passed string if a translation is available, or return it unmodified.

So if you'd put these kind of strings in your view:

<?php __('My untranslated string.'); ?>

It should work out just fine, it always works for me this way.

icc97
  • 11,395
  • 8
  • 76
  • 90
Oldskool
  • 34,211
  • 7
  • 53
  • 66