Re: [HOWTO] Convert old ISO to UTF-8 for ICMS 1.1

I hate GUI which slow my works down.

I usually use nkf to convert things to UTF-8 (without BOM) as following:

$ cd /path/to/language/directory $ nkf -w --overwrite *.php *.tpl *.html


iconv also can do the same task.
Quote:


$ iconv --help
Usage: iconv [OPTION...] [FILE...]
Convert encoding of given files from one encoding to another.

Input/Output format specification:
-f, --from-code=NAME encoding of original text
-t, --to-code=NAME encoding for output

Information:
-l, --list list all known coded character sets

Output control:
-c omit invalid characters from output
-o, --output=FILE output file
-s, --silent suppress warnings
--verbose print progress information

-?, --help Give this help list
--usage Give a short usage message
-V, --version Print program version

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.

For bug reporting instructions, please see:
<http://www.gnu.org/software/libc/bugs.html>.

Topic


[HOWTO] Convert old ISO to UTF-8 for ICMS 1.1

  • 2008/5/1 2:50:27
  • ep98

How to convert old and unmaintained translations from ISO to Unicode UTF-8*

* UTF-8 without Byte of Mark

1. U need editor like NotePad Plus, u can get it from http://notepad-plus.sourceforge.net/uk/news.php?lang=uk
2. Open the selected file from modules\module-name\language\selected-language\thefile.php

Now press CTRL+A for Select All, then CTRL+C to copy the selection into your clipboard, then pick the drop-down menu format, and select
Encode in UTF-8 without BOM and press CTRL+V to paste it from your clipboard, then save it and re-upload it to your XOOPS 2.2/Impress 1.1 language folder.

BUGS:
If u click by mistake Encode in UTF-8 u will get blank page. OOPS core can't recognize UTF-8 encoded files. You can solve the blank page problem, by repeating the above procedure.

If u do this for XOOPS 2.0.18.1, u will get everything else as symbols on your screen, but not your language :)

If u wanna try this on XCL, feel free to do it and report any results :)

The following procedure works on any XOOPS up to phppp 2.0.17.1, and there is no need to apply "USE MULTIBYTE 1" in your language\global.php.

For OOPSes up to 2.0.17 (from 2.0.7.3), u simply have to set in global.php UTF-8 instead of ISO, and to add to your .htaccess the following line.


PHP_FLAG default_charset UTF-8

Topic


Re: [HOWTO] Translating Onokazu Xigg

Impressive collection of activities and research, congratulations for this. Maybe now I will get work properly with this great Xigg module.

Giba


[HOWTO] Translating Onokazu Xigg

  • 2008/5/1 2:35:43
  • ep98

First u need to download XIGG 1.0.0
http://impress.ilivanov.info/modules/mydownloads/singlefile.php?cid=3&lid=1
Second u need a GNU Gettext editor like PO Edit
http://www.poedit.net/download.php

Now extract somewhere xigg-1.0.0b1 (xigg-1.0.0), 1.0.0b1 doesn't have any changes except the version number.

Open Xigg_XOOPSCube_all-1.0.0b1\xoops_trust_path\PEAR\SabaiXOOPS.php

on line 154, u have to found


function getLocales()

.....

and the locales, few locales (and this is not the best way of "getting locales"), but anyway...

You will see something like


'de' => array('ISO-8859-1' => 'de_DE.ISO8859-1',
'UTF-8' => 'de_DE.UTF-8'),
'es' => array('ISO-8859-1' => 'es_ES.ISO8859-1',
'UTF-8' => 'es_ES.UTF-8'),


And you have to add your locale as how it comes for your country.
Eg. for Greeks - el_GR.UTF-8, for Hebrew - he_IL.UTF-8 or ko_KR.UTF-8 for Koreans. Then save the changes and proceed with the GNU Gettext translation of the .PO files. After u completing translation, create the following folders.

in Xigg_XOOPSCube_all-1.0.0b1\xoops_trust_path\PEAR\Xigg\locales

create a new folder called


xx_XX.UTF-8

Where xx_XX is your locale, inside this folder create LC_MESSAGES and put the two files created by PO Editor something.po and something.mo inside that folder, then rename both files to xigg.mo and xigg.po.

And you are in :)

All language codes listed in GNU Gettext
http://www.gnu.org/software/gettext/manual/gettext.html#Language-Codes

for some countries like Portuguese, u have to pick between pt_BR ot pt_PT, but in both ways have to finish with .UTF-8. eg. pt_BR.UTF-8 or pt_PT.UTF-8.

NOTE: For Impress 1.0/XOOPS 2.0.18 users, change global variable in /language/your-language/global.php from ISO8859-1. On some HSP set PHP_FLAG to UTF-8 in your .htaccess or wait for the RC of Impress 1.1.

Thanks to:
... damaster for loosing my time once again (Searches some times works, but if everyone sends newbies to the the Search, noobs will gone to something more newbie friendly like ICMS :).
... messy Cube forums
... IBM for the detailed info about Multi-locale Support with UTF-8
... and Onokazu for his great work on Xigg




 Top