translate icon indicating copy to clipboard operation
translate copied to clipboard

Add new nsh2po and po2nsh converters

Open unho opened this issue 14 years ago • 4 comments

Version: trunk

NSH files are used by NSIS, a script-driven Windows installation system which is used by Mozilla, OpenOffice, Inkscape... Windows installers. More info about NSIS in http://en.wikipedia.org/wiki/Nullsoft_Scriptable_Install_System

I can't locate a formal spec of this format, only some comments in http://nsis.sourceforge.net/Include/LangFile.nsh saying that:

Language strings in the language file have the format: ${LangFileString} LANGSTRING_NAME "Text"

But you can use this sample files: http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/packaging/win32/languages/English.nsh http://www.geogebra.org/trac/browser/trunk/geogebra/installer/nsis/Contrib/Language%20files?rev=6053&order=name

If you search the Internet you can find several dozens of examples.

unho avatar Jan 27 '11 21:01 unho

I know this one is rather old but is there any plan for a direct support?

yarons avatar Jun 21 '18 08:06 yarons

Another example: https://git.videolan.org/?p=vlc.git;a=blob;f=extras/package/win32/NSIS/languages/BosnianExtra.nsh;h=647a101e1faac098f4452bb0526a4861309ca972;hb=8d432b090e08f141ce9156dc728afbed4636301b

nijel avatar Jun 21 '18 08:06 nijel

I got an official reply from the NSIS lead developer: http://forums.winamp.com/showthread.php?p=3157439#post3157439

Also pasting it here:

There is no spec for the .nsh translation files. It's syntax is the same as other NSIS .nsh files. In short that is:

  • Line comments start with ; or #
  • Block comments (like C) with /* and */
  • Quotes around strings: One of ", ' or ` (Pick what you want but they have to be paired)
  • Preprocessor instructions start with !

NSIS v2 files are usually encoded in the codepage used by that language. NSIS v3 uses UTF-8 BOM. NSIS v3 also supports inserting Unicode codepoints (${U+1234} etc). NSIS v2 is not accepting new translations, only bugfixes.

Each string is used in a single place and plural form should follow the English translation. We expect most people to just take the latest English file and translate it: https://sourceforge.net/p/nsis/code/HEAD/tree/NSIS/trunk/Contrib/Language%20files/English.nsh

The comments/credits at the start is optional but we generally prefer the Windows language id and the authors name there. You can add a e-mail and/or website address there as well if you wish. If there is no author credits in the .nlf nor the .nsh then we will be unable to add your credits to the documentation.

The next line is a bit tricky and has changed over the years, "!insertmacro LANGFILE" wants

  1. The .nlf filename (you don't have to get this correct, we can change it later if required) but ideally this name should be plain ASCII. It is never displayed to the user.

  2. The English name of the language. Unicode characters are technically allowed but should not happen in practice because English is plain ASCII.

  3. The native official name of the language, in Unicode.

  4. The native name of the language, in ASCII. Might not be possible in all languages but try your best.

(see French.nsh, Greek.nsh and PortugueseBR.nsh for examples)

The rest of the strings are just translated from English.

yarons avatar Jul 01 '18 09:07 yarons

Is this comment helpful enough? Do we need any further information for the implementation?

yarons avatar Sep 18 '18 08:09 yarons