Old 1st July 2018, 06:17   #1
yaron
Junior Member
 
Join Date: Jun 2018
Posts: 2
Post NSH translation file specification

Hey,
The guys at "translate.co.za" are having some question regarding the NSH file specifications:
https://github.com/translate/translate/issues/1858

When looking at PO files then there are several uncovered areas in regards to this format such as:
  • Plural Forms (If any)
  • Comments
  • Credits
  • Character Encoding
  • Headers
  • Placeholders

I guess there are more aspects I just don't know.

Is there any way I can get involved and improve the specs?
yaron is offline   Reply With Quote
Old 1st July 2018, 09:29   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,891
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/...es/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.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 1st July 2018, 09:50   #3
yaron
Junior Member
 
Join Date: Jun 2018
Posts: 2
Updated the original issue

I've added your reply as a comment in the original issue I've linked to.

Hoping we'll see some results soon, maybe they'll ask for further elaboration about certain issues.
yaron is offline   Reply With Quote
Old 5th July 2018, 12:32   #4
Vasek
Junior Member
 
Join Date: Dec 2011
Posts: 9
To Anders
Is the following line correct?
!insertmacro LANGFILE "Czech" = "Czech" = "Čeština" = "Cestina"


Or this line would be better?
!insertmacro LANGFILE "Czech" = "Czech" "Čeština" "Cestina"
Vasek is offline   Reply With Quote
Old 5th July 2018, 14:55   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,891
Quote:
Originally Posted by Vasek View Post
To Anders
Is the following line correct?
!insertmacro LANGFILE "Czech" = "Czech" = "Čeština" = "Cestina"


Or this line would be better?
!insertmacro LANGFILE "Czech" = "Czech" "Čeština" "Cestina"
The last one is almost correct, it must be "Czech" "Czech" "Čeština" "Cestina" or "Czech" = "Čeština" "Cestina"

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 5th July 2018, 15:51   #6
Vasek
Junior Member
 
Join Date: Dec 2011
Posts: 9
Thanks!

So, is the English line in the English.nsh correct?

!insertmacro LANGFILE "English" = "English" =

IMHO: This is confusion for the translators.
Vasek is offline   Reply With Quote
Old 5th July 2018, 17:18   #7
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 4,891
Yes, it is correct but a bit confusing. = is just a shortcut.

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Tags
nsh, pot, spec, translate

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump