Problem with translation files

Hey mates,

quick question:
I wrote a module (which works almost correct), but i have a small issue regarding translation files. So, for some reason, my constants aren’t replaced when i add strings to my translation-file.

My lang-file is stored in: /modules/mycollection/myname/out/admin/de/myname_lang.php

So. Nothing happens when i try to translate / replace the constants.

// its a backend-module, btw and I’m using oxid 4.8.6 PE

however: if i try to add lines to the file:
/application/views/admin/de it DOES translate these lines…

any ideas?

thanks,
Daniel

You have a line with ‘charset’ in your langfile? Because langfliles without charset line get ignored.

Yep, i have:


$sLangName = "Deutsch";
$iLangNr = 0;

$aLang = array(
        'charset' => 'UTF-8',
        'SHOP_MODULE_sCmsSite' => 'CMS Seite (Template)'
    );

Nevermind, adding the charset and cleaning temp did the trick. Thank you very much :slight_smile:

Okay … nevermind again (i guess…)
So, i have this translation-file:


<?php

$sLangName = "Deutsch";
$iLangNr = 0;

$aLang = array(
    'CHARSET' => 'UTF-8',
    'SHOP_MODULE_GROUP_main' => 'Allgemeine Parameter',
    'SHOP_MODULE_blPromoboxActive' => 'Aktiv',
    'SHOP_MODULE_sPromoboxType' => 'Boxtyp',
    'SHOP_MODULE_sPromoboxType_video' => 'Video',
    'SHOP_MODULE_sPromoboxType_textimg' => 'Text und Bild',
    'SHOP_MODULE_blPromoboxVideoOverlay' => 'Video als Overlay',
    'SHOP_MODULE_sMainHeader' => 'Hauptüberschrift',
    'SHOP_MODULE_sHeader' => 'Überschrift',
    'SHOP_MODULE_sDescription' => 'Text',
    'SHOP_MODULE_sImage' => 'Bild (Dateiname, Upload bitte manuell nach "out/pictures/promo")',
    'SHOP_MODULE_sLink' => 'Linkziel (komplette URL, leer bei Video)',
    'SHOP_MODULE_sVideo' => 'Video-Einbettung (nur Video ID von YouTube)',
);

located in out/admin/de/mod_lang.php. It is not effecting the backend.
I checked the langNumber and 0 is correct for german.
the shortcut (de) is correct as well
Its simply not triggering this file.

So i thought, this might be a problem with my server …
so i made a new one with the newest oxid version, bought a module from the store (which said it is compatible with 4.8.x) - same effect. Not translated.

Help :frowning:
I have no idea what else i can be :\

String “Charset” should be lowercase i think:

   'charset' => 'UTF-8',

[QUOTE=leofonic;148122]String “Charset” should be lowercase i think:

   'charset' => 'UTF-8',

[/QUOTE]

So i tried it lowercase an “Charset” as well … still no translating :confused:
i cleaned the tmp folder.

// edit: just tested another charset (ISO-8859-15) - still no effekt

Don’t know whether it makes a difference but the options file should be named module_options.php and $iLangNr ist not needed anymore.

[QUOTE=leofonic;148130]Don’t know whether it makes a difference but the options file should be named module_options.php and $iLangNr ist not needed anymore.[/QUOTE]

_options instead of _lang? Did they change that?

Only for module options translations, Have a look at the paypal module or http://article.gmane.org/gmane.comp.php.oxid.general/1776

recommendation:
put at the end of /modules/mycollection/myname/out/admin/de/myname_lang.php one line:

var_dump($aLang);

then you see if file is loaded (I guess not :frowning: )
in second step you can troubleshoot your definitions …

Well … i added a


die('i am here');

it even displays it … but if I remove it again, it still stays.
tmp cleared as usual … seems to be a fishy caching problem

Okay, don’t ask me why, how or when … but after 3 days, i somehow managed that the strings ARE translated. Thank you very much guys.