Forums / Extensions / my transaltion in my new extension fails to translate when it includes the "å" charachter

my transaltion in my new extension fails to translate when it includes the "å" charachter

Author Message

Torbjørn L.

Thursday 23 December 2010 4:43:46 am

I have made a new extension.

In that extension I have created a translation folder, and a sub-folder for the correct language.

I can get a translation for an object in my new translation file, so the setup works. But if I add an "å" in the translation section it will not translate. Ie I get the original word.

But if I use an existing translation from ezwebin which contains "å" - it works like a charm.

I have tried with different headings in my translation.ts file, its more or less a variation of these:

<!DOCTYPE TS><TS>

and

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.0">

But I still can't show any translated "å" my frontend.

I have no idea about what's going on..... since I can translate, and I can show "å" from an existing .ts file, I don't understand why my translation with "å" fails to show....

Edi Modrić

Thursday 23 December 2010 5:24:06 am

Hi Torbjørn,

I have just tested translating a string with "å" on my demo installation and there aren't any problems. The string was translated fine.

Make sure that both your translation.ts file and tpl file where you use i18n operator, are saved as UTF-8.

It's not enough to just put encoding="utf-8" at the top of the files. They need to be saved as UTF-8 too. Any better text editor allows you to save your files in UTF-8 encoding.

eZ Publish certified developer

http://ez.no/certification/verify/350658

Torbjørn L.

Thursday 23 December 2010 2:48:00 pm

Thanks!!

That solved it, I didn't realise the need to make the file UTF-8 as well....

I obviously missed that information, so maybe the need to put the file format in UTF-8 as well should be made more visible?

If it is clearly stated, then I shall rightfully shut up:)

Anyways - I greatly appreciate the help!

Edi Modrić

Monday 27 December 2010 2:18:53 am

I can't say for sure where it is written, but I do remember reading that from version 4.0, eZ Publish requires practicly everything to be UTF-8 encoded. That includes, database, templates, translation files.

There is a paragraph in upgrade docs about DB needing to be in UTF-8:

http://doc.ez.no/eZ-Publish/Upgrading/Upgrading-to-4.0/from-3.10.x-to-4.0.y

eZ Publish certified developer

http://ez.no/certification/verify/350658