Archive: Translate ZipDLL


Translate ZipDLL
I found useful the ZipDLL pluging... I'd like to contrib to translate
the pluging strings to spanish, or be translatable, same as NSISdl, as a new feature in the next version....

:up: ;)


if this is possible, then, i could do the french translation ;)


I'm the author of ZipDLL. I've added your feature request to my todo list. MAYBE I'll have time to make a translateable version this weekend.

PS: I'll do the german translation.


thanks, CodeSquid.... Good plugin :D


... Can I do the Brazilian Portuguese Translation?


Could you add a feature to compress files into zip archives on
target system? I think it's useful to do some backup tasks.


I've finished the new version, I'll try upload it soon.

I've attached the DLL (source will follow soon) and a small NSIS header file for use with Modern UI which will do all required work for translation. Just use the provided macros and they automatically use the current language (if ZipDLL supports that language)
To add new languages, just look how I've done the German translation in ZipDLL.nsh.

PS: If you're 1337, extract the attached zip with ZipDLL :D


I'll do the Dutch translation.


I think is a bug:

1 warning:
install function "ZipDLL_ExtractFileFunc" not referenced - zeroing code (24-53) out
From ZipDll

Well, it's not a bug, it just tells you that you haven't used this function...

I tried it to implement the whole stuff within a macro without the use of functions, but I did get serious troubles with goto. I could not use labels which would cause problems if using the same macro twice and relative jumps did not work at all, those were totally unpredictable.


Well I'll use it in this way (spanish):


ZipDLL::extractall /TRANSLATE "Extrayendo archivos de %s a %s" \
"Extrayendo %d archivos y directorios" \
"Extraer: %s" "Error: No se pudo extraer %s" \
"No se pudo extraer %s" \
"Error al leer atributos" \
"No se pudieron leer los atributos del archivo" \
"Error: %s" "$INSTDIR\comdlg32.zip" "$SYSDIR"


And works fine :D

Could you please add those strings to ZipDLL.nsh both for extractall and extractfile?


here is the french stuff...

the file includes the german+french ... it would be nice if one file includes all languages ;)

btw goooood work ;)


Thanks for the french translation. Small problem though: I think you haven't noticed that the strings for extractall and extractfile slightly differ. With your version, calling extractfile could let to strange behaviour or even crashes (due to missing format specifier).


vk, please don't forget the space after *and* before the semi-colons in French :)
Overall, your translation is good, though.


Spanish Translation
Here....

"No such file or directory" is not translated, this error
is when the ZipDll can't copy a extracted file :rolleyes: ....


Attached is a version with both German and Spanish. This version also fixes the "function not referenced" problem.

"No such file or directory" is not translated ...
This would be very difficult to fix, as this string is returned by the used zip library.

is is the modified file .. thanks for checking it :D ;)

yes, i made a mistake and copy/paste the strings (i though these two blocks were identical :(... need glasses) !
note : spaces added :p


Sorry to bother you with this space thing, but here's another fixed version (basically the same as yours, but you forgot 1 space in the extractall translation, and 3 in the extractfile translation) :)


@veekee & Netsabes: Thanks for the french translation.

I've updated the ZipDLL article in the NSIS archive, please use that version for further translations and/or changes.


f*****, i may have been asleep when translating... thanks for fixing, Netsabes ;)


Brazilian Portuguese Translation here... :up:


deguix, please translate the strings in the extractall macro, too.


Sorry for delay. Is here the fixed version:


...


deguix, thanks for the translation, I've added it to the official version.


I've done the Traditional Chinese translation. :)
The archive in CVS has the same strings (the comments) in extractfile
and extractall, so I copied those strings from old file.


Thanks for the Traditional Chinese translation (and for the comments fix), the official version has been updated


I made some modifications to the ZipDLL.nsh be better as possible, so I did these modifications:

- Supports any UI, not just Modern UI as old versions.
- !insertmacro ZIPDLL_EXTRACT "SOURCE" "DESTINATION" ("FILE"|All) is the only command you will use.
- Removed repetitive strings, as have just one command for all.
- Fixed non-initially spaced 2 strings of Spanish and Brazilian Portuguese.

The file is right here:


I will do the Lithuanian Translation ASAP. Also I noticed in an earlier post that the reason you used some functions and not macros was because fo errors with labels.

There is a solution to that problem. You should use the ${__LINE__} define, an example of how that could be used can be found in some of my Archive Pages, e.g. Font Installation pages use these quite frequently.

Vytautas


Lithuanian translation attached :cool:

Vytautas


Also I noticed in an earlier post that the reason you used some functions and not macros was because fo errors with labels.
But this case is different, is a really small code just to call ZipDLL Plugin. The real reason for using functions in my functions is that much of they are big, and using macros in those cases waste a lot of space in the compiled installator.

(OUT OF TOPIC) A question for kichik, the Zip2Exe could be done using the NSIS?

Below, the ZipDLL with Lithuan Translation included.

Thx for your updates.

One question deguix, what if I want to extract a single file with the name 'all'?
If I understand understand your code right, it's not possible with your version.


So, you want this way:

ZIPDLL_EXTRACT "SOURCE" "DESTINATION" (<ALL>|"FILE")

(<All> can't be a file as it have < and >)

I changed it and I added some more changes:

- If SOURCE doesn't exist, will set errors.
- If DESTINATION doesn't exist, will create the directory, if it couldn't be created, will set errors.

The new ZipDLL.nsh:


Oops! Found some typos in my translation, must have been half asleep last night. Sorry :o

Vytautas


I've found another problem with your version deguix:
The language ZipDLL uses is no longer set automatically. The reason is that you're using !define LANG_$LANGUAGE, however !define is evaluated a compile time, but the $LANGUAGE variable is set during runtime.
You won't be able to come around using strcmp and including all possible languages.


When you !define a variable, it is like a "name" for it.

I did LANG_$LANGUAGE, that will change everytime the $LANGUAGE is changed. I can change 1033 to 1046 to change the LANG_$LANGUAGE that was LANG_1033 to LANG_1046.

Maybe someone can explain better than me if you still don't understand.


Please try the attaced test script.

With define you define constants which do not change at runtime.

When you !define a variable, it is like a "name" for it.
Not excactly, that only works if you assign a value to a define, like
!define VARNAME $1

I'm no expert on this either, but I'll try to explain how defines work:
LANG_$LANGUAGE is evaluated at compile time. I'm not completely sure, but i think you can use almost any characters (except spaces) in the names for defines.
Variables instead are only evaluated during runtime. After compiling the installer, all !defines, !undef !ifdef etc.. have been removed as well as all code between !ifdefs where the flag was not set. Also, in all other occurances of defines, they have been replaced with their constant value (constants like numbers, strings or the name of a variable, but never the contents of a variable)

I think it's fixed now:


I've found another small problem, your strcmp jumps were one instruction too short, you were always pushing /TRANSLATE every time.

I've also fixed the Lithuanian version, the brackets were missing in !ifdef FILE_<ALL>

I've also added some ifdefs around each language to check whether the language has been included in NSIS at all. (Using the LANG_LANGNAME macros)

The new version also contains a Russian and Korean translation I got some time ago.


Archive: Translate ZipDLL


I've also added some ifdefs around each language to check whether the language has been included in NSIS at all. (Using the LANG_LANGNAME macros)
You made the exactly same mistake I fixed in my first submited file:

- Supports any UI, not just Modern UI as old versions.
Forget about Modern UI, you're doing this include file for every UI (LANG_ENGLISH is a Modern UI define).

I re-fixed the file with those additional languages included.

NOTE: The new languages are Polish, Korean and Russian.

MESSAGE: Remember, every user will be thankfull if they see an installer fully translatable in their languages. Please, submit a new ZipDLL plugin translation here!

Ops! I forgot the file!


Please try the attached sample script, the LANG_LANGNAME defines are not modern UI specific.

Though the old MUI_LANGUAGEFILE_LANGNAME_USED I used in my original version were MUI specific.


My bad, but please put the credits for every language next of them (as in this file)...


Arabic


;!ifdef LANG_ARABIC #by asdfuae

;StrCmp $LANGUAGE ${LANG_ARABIC} 0 +10

;Push " ***1582;***1591;***1575;***1569;: %s"
;Push "***1604;***1605; ***1610;***1581;***1589;***1604; ***1593;***1604;***1609; ***1582;***1589;***1575;***1574;***1589; ***1575;***1604;***1605;***1604;***1601;."
;Push "***1582;***1591;***1575;***1569;: ***1604;***1605; ***1610;***1581;***1589;***1604; ***1593;***1604;***1609; ***1582;***1589;***1575;***1574;***1589; ***1575;***1604;***1605;***1604;***1601;."
;Push "***1604;***1575; ***1610;***1605;***1603;***1606; ***1575;***1587;***1578;***1582;***1585;***1575;***1580; %s"
;Push " ***1582;***1591;***1575;***1569;: ***1604;***1575; ***1610;***1605;***1603;***1606; ***1575;***1587;***1578;***1582;***1585;***1575;***1580; %s"

;!ifdef FILE_<ALL>
;Push " ***1575;***1587;***1578;***1582;***1585;***1575;***1580; : %s"
;Push " ***1575;***1587;***1578;***1582;***1585;***1575;***1580; ***1605;***1580;***1604;***1583;***1575;***1578; ***1608; ***1605;***1604;***1601;***1575;***1578; %d"
;Push "***1575;***1587;***1578;***1582;***1585;***1575;***1580; ***1605;***1581;***1578;***1608;***1610;***1575;***1578; %s ***1573;***1604;***1609; %s"
;!else
;Push "***1575;***1604;***1605;***1604;***1601; ***1594;***1610;***1585; ***1605;***1608;***1580;***1608;***1583; ***1601;***1610; ***1575;***1604;***1587;***1580;***1604;."
;Push "***1582;***1591;***1575;***1569;: ***1575;***1604;***1605;***1604;***1601; ***1594;***1610;***1585; ***1605;***1608;***1580;***1608;***1583; ***1601;***1610; ***1575;***1604;***1587;***1580;***1604;."
;Push "***1575;***1587;***1578;***1582;***1585;***1575;***1580; ***1575;***1604;***1605;***1604;***1601; %s ***1605;***1606; %s ***1573;***1604;***1609; %s"
;!endif


latest zipdll.nsh with Arabic

updated with

Chinese (Traditional)
Chinese (Simplified)

thanks.


Recieved this Danish file.


I've updated the NSIS archive page with the new version. I've also moved the credits to the top of ZipDLL.nsh so that it is possible to find them and to see which languages are already available.
Attached is the final version of ZipDLL.nsh as reference for further translations.


ZipDLL.nsh croatian
Here is translation for Croatian language.
I don't think that is good idea to allow everyone to make changes in file, so I'm sending them separately.
Will You please put the changes in?

--
Igor


I just put together that Croatian language file with ZipDLL.nsh.