At least on Windows this now will make things work correctly, as the gtk
localization is named nb - so nb_NO.UTF-8 is consistent with that.
MacOS still appears to need some special handling.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I don't know any Spanish at all. This translation was made with
Google Translate, perl and sed, and will annoy anyone who knows
Spanish. Hopefully enough so that they will fix it.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit adds an install-cross-windows target to the Makefile that
creates a staging directory for us under packaging/windows that contains
the required .mo files. This currently fails for the Norwegian translation
because of the no_NO.UTF-8 vs nb issue - right now we just use the first
component of our own localization filename to find the matching Windows
localization and that fails.
The subsurface.nsi file is updated accordingly and this now appears to
create working installers with sane paths for the localization files.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Dirk had some changes in commit f1569a206e
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This still requires on carefully staged files in the packaging/windows
directory. Specifically:
- the dll directory (or symlink) points to the installed gtk Windows DLLs
- the mydll directory (or symlink) contains six other DLLs (where the
cross built DLLs from Fedora for some reason file, but can be
transparently replaced with the ones from the upstream binary
package
- the share directory contains the Windows gtk locale files (but only for
the locales that we support, anyway)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is mostly a quick hack to be able to test localization under Windows.
It seems to work fine under Windows 7
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Consistently use "Ø" for average.
Use Tauchgruppenleiter and Leiter instead of Tauchgruppenführer and
Führer.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
We marked the strings for translation, but then didn't actually call the
translation function on them.
Our dates are still not truely localized as we have hand written code for
the date / time handling that constructs the dates according to US fashion
as [Weekday], [Month] [Day of Month], [Year] [hh:mm]
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- Use message context for better translation
- Fixed some strings to form proper sentences
Signed-off-by: Tommi Saviranta <wnd@iki.fi>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The existing code passed a localized copy of a text buffer initialized by
a static string to a function that ended up wanting to modify the buffer.
Unsurprisingly, that doesn't work. This commit restructures the code so
that we initialize the buffer at run time with a localized version of the
default string and then just pass the buffer around.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Here's the Swiss-(High-)German translation which is mostly based on the
German translation.
Most notable differences are:
- in Switzerland, 'ß' doesn't exist (fortunately)
- keep some English words where the German translation sounds strange or
unfamiliar (nobody in Switzerland would ever use the word
Tauchgruppenführer)
Signed-off-by: Martin Gysel <me@bearsh.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The MacOSX applications bundle needs to be told where to bind the
text domain from.
Also copy the gettext .mo files in the install-macosx target.
[Dirk Hohndel: minor change in main(): move the path declaration to
the beginning of the function]
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
- fix two missing strings in equipment.c (thanks to Tommi Saviranta for
pointing this out)
- add context for the translations of the Yearly/monthly statistics. The code
for this ended up being incredibly ugly, but the gettext infrastructure
really clashed with the way this is implemented. What I have now at least
works (tested with the German translation)
- merge the new strings into all the po files. The non-German translations need
to be updated. Make sure you remove the "# , fuzzy" lines or the current
Makefile will ignore those additions.
- some minor cleanup of the po files (many listed the wrong language, all of
them copied my incorrect use of PACKAGE (instead of saying "Subsurface").
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Finnish translation was with wrong character encoding resulting in
compile error.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The changes were mostly suggested by Lutz, but since he didn't send a
patch, I manually applied them.
Suggested-by: Lutz Vieweg <lvml@5t9.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This translation is partly based on Finnish Divers' Federation's printed
dive log and partly on my best guess. Some of the translated strings
have been (badly) shortened to fit the UI, and many others still neen be
shortened.
Signed-off-by: Tommi Saviranta <wnd@iki.fi>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
My previous take at adding gettext to the Makefile wasn't very good,
since it always relinked the subsurface executable.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is a horrible mish-mash of the english and norwegian translation
and my random odd swedish translations of them.
It's bad. But it's a starting point. If somebody complains, they
hopefully say things like "That should be xyz" and it can be fixed.
[Dirk Hohndel: minor edit to the .po file to at least no longer claim to
be Norwegian...]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Some of the exact translations of terminology such as SAC (ППК) might
need a revision by an expert. Also, some of the things ended up being up
2-3 times longer (similar to German), so I'm not sure how this is going to
reflect on the UI.
[Dirk Hohndel: minor fixes to the .po file to make it compile]
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added the missing translations for the File menu et al.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
It appears that at least for Norwegian the translations of the stock menu
entries was missing. This patch adds those as explicit strings and merges
those new strings into the .po files.
The translations need to be updated in separate commits.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This fixes an oversight in commit 881a2df83616 ("Conversion to gettext to
allow localization") - string literals that are marked with N_ need to be
converted when the corresponding variables are used at runtime. This was
missed for the divelist headers.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Added basic support for building gettext locales in the Makefile.
The po file name should match the target locale.
[Dirk Hohndel: Used git mv to rename the German .po file]
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Without "-headerpad_max_install_names", gtk-mac-bundler would complain
with "changing install names or rpaths can't be redone for:
/Applications/.subsurface.app/Contents/MacOS/subsurface-bin (for
architecture x86_64) because larger updated load commands do not fit"
Also, libdivecomputer needs to be configured with --with-prefix=/opt/local
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This file was created with "msginit --locale=no_NO --input=deutsch.po"
and edited with poedit afterwards.
The correct locale for Norwegian Bokmål really is nb_NO, but this is
a new-ish construct, and that locale doesn't seem to be available
on MacOSX. We might need to create .mo files in both
locale/no_NO.UTF-8 and locale/nb_NO.UTF-8 to satisfy all platforms.
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds a few fields that we parse, but more importantly it also tries
to dynamically decide if the sample temperatures and pressures are in
imperial or metric units.
Dirk suspects that DivingLog generally always does everything in metric,
and the reason why he has crazy sample data in imperial units (both for
pressure and temperature) may be due to a bug in the early Uemis
importer for DivingLog.
Which would actually make a lot more sense than DivingLog really being
so insane on purpose.
Anyway, Dirk's brother Jurgen seems to have everything in metric units,
which would be much saner. Maybe we should throw away the support for
insane DivingLog files entirely, since it is possible that the only use
ever of the possible source of that bug was Dirk's use of the Uemis
importer.
But for now, we end up just guessing. Current guesses:
- water temperature is below 32 dgC, so 32+ degrees is in Fahrenheit.
- tank pressures are below 400 bar, so higher values than that must be
psi.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This is just the first step - convert the string literals, try to catch
all the places where this isn't possible and the program needs to convert
string constants at runtime (those are the N_ macros).
Add a very rough first German localization so I can at least test what I
have done. Seriously, I have never used a localized OS, so I am certain
that I have many of the 'standard' translations wrong. Someone please take
over :-)
Major issues with this:
- right now it hardcodes the search path for the message catalog to be
./locale - that's of course bogus, but it works well while doing initial
testing. Once the tooling support is there we just should use the OS
default.
- even though de_DE defaults to ISO-8859-15 (or ISO-8859-1 - the internets
can't seem to agree) I went with UTF-8 as that is what Gtk appears to
want to use internally. ISO-8859-15 encoded .mo files create funny
looking artefacts instead of Umlaute.
- no support at all in the Makefile - I was hoping someone with more
experience in how to best set this up would contribute a good set of
Makefile rules - likely this will help fix the first issue in that it
will also install the .mo file(s) in the correct place(s)
For now simply run
msgfmt -c -o subsurface.mo deutsch.po
to create the subsurface.mo file and then move it to
./locale/de_DE.UTF-8/LC_MESSAGES/subsurface.mo
If you make changes to the sources and need to add new strings to be
translated, this is what seems to work (again, should be tooled through
the Makefile):
xgettext -o subsurface-new.pot -s -k_ -kN_ --add-comments="++GETTEXT" *.c
msgmerge -s -U po/deutsch.po subsurface-new.pot
If you do this PLEASE do one commit that just has the new msgid as
changes in line numbers create a TON of diff-noise. Do changes to
translations in a SEPARATE commit.
- no testing at all on Windows or Mac
It builds on Windows :-)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Only files that are opened should be considered r/w. Files that are
imported should be treated as if they were r/o.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.7.7:
"Sets the context of $SMPROGRAMS and other shell folders. If set
to 'current' (the default), the current user's shell folders are used.
If set to 'all', the 'all users' shell folder is used"
Specific to the Windows installer.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Before this commit we had the odd behavior that if we right clicked in the
middle of a group of selected dives, the trip was added above the dive we
clicked on, not above the group.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Before setting a new font we try to free the existing font. Sadly if no
config value is set for the default font, we assign a string literal.
Which of course means that subsurface dumps core when trying to free it.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Right now the menu and button images are a distribution choice - some
have them on, some have them off. I kinda like them and think that even on
OSs that have them off by default this doesn't look out of place (as other
apps clearly do the same).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
windows.c:
Windows's registry (which is technically a filesystem) uses UTF-16
for its "keys". This forces us to convert each of our UTF-8 (GLib, GTK)
configuration entries if we want to store special characters. To do that
we use the RegQueryValueExW() and do some conversation around
the function call itself.
The opposite happens when we require a UTF-16 value to be read from the
registry and converted to UTF-8 in subsurface_set_conf().
An addition to this patch is a somehow expandable buffer in
windows.c: subsurface_get_conf(). We increase the size of the buffer
in chunks of 64 bytes, until RegQueryValueExW() is able to write to it
(as suggested by the WINAPI documentation).
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Each time we retrieve a string configuration entry via
subsurface_get_conf(), all the multiplatform methods in linux.c,
macos.c, windows.c allocate memory for the returned value.
In gtk-gui.c, lets try to release the memory at:
default_dive_computer_vendor, default_dive_computer_product, divelist_font
before assigning a new address to these pointers.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
For unicode command line characters Windows uses UTF-16, while Glib
and GTK use UTF-8. To solve that we retrieve the command line
via __wgetmainargs() and use g_utf16_to_utf8() to convert each argument.
The used method should support wildcards passed as arguments
(e.g. *.xml).
Two new, OS abstracted functions appear in linux.c (NOP), macos.c (NOP),
windows.c:
subsurface_command_line_init(...)
subsurface_command_line_exit(...)
which are being called in main()
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This was in a patch set from Henrik but got dropped at first while we
explored a different solution. So now it comes back as maybe the most
trivial commit, ever :-)
Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>