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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 02:49:42
Script start
Timing: Jan 18 2025 02:49:42
Module start 'layout'
Timing: Jan 18 2025 02:49:42
Module start 'content'
Timing: Jan 18 2025 02:49:42
Module end 'content'
Timing: Jan 18 2025 02:49:42
Script end

Main resources:

Total runtime0.4808 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 589.5391152.6875
Module start 'layout' 0.00610.0021 742.226639.6250
Module start 'content' 0.00810.4712 781.8516550.8750
Module end 'content' 0.47940.0014 1,332.726612.0156
Script end 0.4808  1,344.7422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.6499160.0002
Check MTime0.00130.2737160.0001
Mysql Total
Database connection0.00080.173310.0008
Mysqli_queries0.426088.6044600.0071
Looping result0.00050.1019580.0000
Template Total0.453694.320.2268
Template load0.00230.479020.0012
Template processing0.451393.861820.2256
Template load and register function0.00020.033510.0002
states
state_id_array0.00090.185810.0009
state_identifier_array0.00070.154420.0004
Override
Cache load0.00200.4080320.0001
Sytem overhead
Fetch class attribute can translate value0.00070.142120.0003
Fetch class attribute name0.00140.285850.0003
XML
Image XML parsing0.00070.146220.0004
class_abstraction
Instantiating content class attribute0.00000.003360.0000
General
dbfile0.00080.1757160.0001
String conversion0.00000.001540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 16
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs