Error displaying language in pop-up window

Hi!

When the pop-up window is displayed, the shown text is the raw string.

I´ve checked my language files and are ok:

'question:areyousure' => 'Are you sure?',

Also cleared the cache... Any suggestion to solve this issue?

I´ve Elgg 1.8.20

Thanks!

  • If it works for English but not for other languages it looks like a problem with caching of language files to me.

    As far as I know there were some issues with caching of language files fixed in the Elgg 1.9 branch. I see that you have this problem on Elgg 1.8.20. Is upgrading your site to Elgg 1.9 an option for you? If not, you might want to test at least on an Elgg 1.9 test installation with the same plugins that have this error on Elgg 1.8 if the error still occurs. This won't help you immediately if you can't upgrade your production site yet. But you would at least know if the problem is already fixed in Elgg 1.9.

  • I´ve tried disabling simple and system cache but problem still persist.

    I plan to upgrade to 1.9 version but for now I think it can not be achieved because I´ve a huge amount of plugins (standard and own plugins).

    Anyway I´ll start mounting a testing 1.9 installation to go forward to the upgrade.

    Thanks. 

  • News about this issue, in my plugin "Socialcommerce" this problem does not occur. I´ve been looking for the possible reason and I see this plugin uses the function:

    register_translations(elgg_get_plugins_path() . get_config('pluginname')."/languages/");

    I´ve been trying it in other plugins but problem persist... Any idea about what this pluging can be doing  to solve this problem?

     

  • register_translations() shouldn't be necessary for the language files to be correctly loaded if the are to be found in the default languages folders.

    As I said before: it might be a bug in Elgg 1.8 that might have been fixed in the meantime. Have you tested on Elgg 1.9 yet?

    Another way would be to place all language files of one language into one place. In this case you can load them all from this location with

    register_translations('path/to/language_files', true);

    This is the way I've chosen for the German translations plugin (https://community.elgg.org/plugins/788318) - but rather to provide a better way to enable/disable the translations like a normal plugin and for easier upgrading of language files.

  • @iionly still not tested with 1.9, anyway it not will be a solution for me by now.

    On the other hand, I think exist other way to solve it in 1.8, since Socialcommerce plugin is working ok in my Elgg 1.8, but I don´t find which is the "magic" of this plugin.   

  • As I understand you, the Socialcommerce plugin uses register_translations(). This IS the "magic". The translations should be loaded automatically on normal circumstances which would usage of register_translations() unnecessary. But the automatic loading fails on your site for some reason (caching issue, buggy plugin, invalid language file, optcode caching - there are many reasons and I can't say what might the the cause). But the language files that are loaded by register_translations() are explicitely "forced" to be loaded. That's why it works in case of the Socialcommerce plugin.

    I had suggested to test it out on Elgg 1.9 to see if the same problem would occur then. If yes, it's likely a problem on your server. If not, it's likely a problem of Elgg (and has been fixed on Elgg 1.9 by now).

    If you can't upgrade to Elgg 1.9 yet, you can load your translations of other plugins with register_translations(), too. I've linked the German translations plugin as an example of how to do it.

  • Problem SOLVED!!!

    After doing a lot of tests (loading traslations in plugins with register_translations() function, creating a separate Spanish language plugin like @iionly, revising some language files and plugins, etc, etc etc) I´ve found the reason:

    >>> Problem comes with the UFT-8 codification, IT MUST BE WITHOUT BOM.

    IMPORTANT: If any language files of the site contains BOM caracteres, all site language traslation fails in pop-up windows.

    Thank you @iionly for your replies, it helped me.