Conversion to gettext to allow localization

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>
Add Norwegian Bokmål translation

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>
Basic gettext support when building

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>
Get divelist headers localized, too

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>
Add Dutch localization

Signed-off-by: Jacco van Koll <jacco.van.koll@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Make translations of menu entries explicit

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>
Update German translations for newly added menu strings

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Updated Norwegian translation

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>
Use lang_COUNTRY.po naming convention for translation files

Rename nl.po to nl_NL.po

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add Bulgarian translation

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>
Add translation files to the Windows installer package

A lot more needs to happen for localization on Windows, but this is the
first step.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add Swedish translation

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>
Better gettext build

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>
Created first french translation of Subsurface

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Slovak translation

Also fixed two typos in the German translations.

Signed-Off-By: Jozef Ivanecký (dodo.sk@gmail.com)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Add Finnish translation

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>
Improve German translations

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>
Change character encoding from iso-8859-1 to UTF8

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>
Improve translations

- 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>
Update po/fr_FR.po

Just a few spelling corrections for fr_FR translation file

Signed-off-by: Jean-Noël Rouchon <jnoel@sissiou.net>