[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kde, language, and openoffice?



>From Alejandro Exojo on Saturday, 2003-12-27 at 13:20:23 +0100:
> El Sábado, 27 de Diciembre de 2003 10:54, Hadmut Danisch escribió:
> > I need to install and configure some debian computers
> > for non-experienced users with KDE and openoffice.
> > Now I have a certain problem:
> >
> > KDE allows to select the user language for the KDE
> > session, but does not propagate this in the environment
> > language. Openoffice allows to set the user language as
> > well, but does not provide a menu option. Instead it requires
> > the environment variable LANG set properly.
> >
> > Since I do not want to set the variable globally and do
> > not want to fiddle with every single account, I'm looking
> > for a way to propagate the KDE language setting into the
> > LANG environment variable (once for all users). Any idea
> > how to do it?
> 
> Please, note that debian-qt-kde is a list for _development_ issues. If you 
> have problems or doubts with the use of KDE, try debian-kde or debian-user, 
> please.
> 
> I'm crossposting to debian-kde, because this is a more accurate place.
> 
> I'm not sure about the solution of your problem, but I suggest to look at 
> /etc/environment, and execute dpkg-reconfigure locales.

In Debian, /usr/bin/openoffice is a shell-script.  You can slightly
modify this script to take the language value from KDE, and use it
as the LANG parameter in openoffice.  I have attached a patch that
I hope should work, at least for Debian's OpenOffice.org 1.1.0

Conrad

--- openoffice.debian.orig	2003-10-24 14:05:19.000000000 +0200
+++ openoffice.new	2003-12-03 16:11:51.000000000 +0100
@@ -169,7 +169,25 @@
   LOCALE="$LC_MESSAGES"
   LANG="$LC_MESSAGES"
 else
-  LOCALE="en_US"
+  KDE_LANG=$(sed -n "s/Language=//p" $HOME/.kde/share/config/kdeglobals | cut -d: -f1)
+  case "$KDE_LANG" in
+  da) LOCALE="da_DK"; LANG="da_DK"; ;;
+  de) LOCALE="de_DE"; LANG="de_DE"; ;;
+  es) LOCALE="es_ES"; LANG="es_ES"; ;;
+  et) LOCALE="et_EE"; LANG="et_EE"; ;;
+  fi) LOCALE="fi_FI"; LANG="fi_FI"; ;;
+  fr) LOCALE="fr_FR"; LANG="fr_FR"; ;;
+  is) LOCALE="is_IS"; LANG="is_IS"; ;;
+  it) LOCALE="it_IT"; LANG="it_IT"; ;;
+  lt) LOCALE="lt_LT"; LANG="lt_LT"; ;;
+  lv) LOCALE="lv_LV"; LANG="lv_LV"; ;;
+  nb) LOCALE="nb_NO"; LANG="nb_NO"; ;;
+  nn) LOCALE="nn_NO"; LANG="nn_NO"; ;;
+  pt) LOCALE="pt_PT"; LANG="pt_PT"; ;;
+  se) LOCALE="se_NO"; LANG="se_NO"; ;;
+  sv) LOCALE="sv_SE"; LANG="sv_SE"; ;;
+  *)  LOCALE="en_US"; LANG="en_US"; ;;
+  esac
 fi
 
 # Set locale to en_US if locale is C

Reply to: