Example #1
0
def get_languages():
    langs = []
    langs.append("en_US")
    path = get_lang_path()
    print(">>>>>>>>>>>>>>>>", get_lang_path())
    if os.path.isdir(path) == False:
        return False

    print(os.listdir(path))
    for my_dir in os.listdir(path):
        if os.path.isdir(os.path.join(path, my_dir)) == True:
            langs.append(my_dir)

    return langs
Example #2
0
def get_languages():
    langs = []
    langs.append("en_US")
    path = get_lang_path()
    for my_dir in os.listdir(path):
        if os.path.isdir(os.path.join(path, my_dir)) == True:
            langs.append(my_dir)

    return langs
Example #3
0
# -*- coding: utf-8 -*-
 
import os, sys
import locale
import gettext
from cal_path import get_lang_path

current_locale, encoding = locale.getdefaultlocale()
print get_lang_path()
locale_path = get_lang_path()
print locale_path, current_locale
#current_locale="de_DE"
language = gettext.translation ('opvdm', locale_path, [current_locale] , fallback=True)
language.install()

def yes_no(a):
	if a.lower() in ("ja","yes", "true", "t", "1"):
		return "true"
	elif a.lower() in ("nein","no", "false", "f", "0"):
		return "false"
	else:
		return a
Example #4
0
def get_full_desired_lang_path():
    return os.path.join(get_lang_path(), get_full_language(), "LC_MESSAGES")
Example #5
0
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License along
#    with this program; if not, write to the Free Software Foundation, Inc.,
#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

import os
import locale
import gettext
from cal_path import get_lang_path
from inp import inp_get_token_value
from cal_path import get_inp_file_path
locale_path = get_lang_path()
config_path = os.path.join(get_inp_file_path(), "lang.inp")
file_lang = inp_get_token_value(config_path, "#lang", archive="base.gpvdm")
if file_lang == None:
    file_lang = "auto"

if file_lang == "auto":
    current_locale, encoding = locale.getdefaultlocale()
    if current_locale == None:
        print("No local language set assuming en_US")
        current_locale = "en_US"
else:
    current_locale = file_lang
language = gettext.translation('gpvdm',
                               locale_path, [current_locale],
                               fallback=True)
Example #6
0
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License along
#    with this program; if not, write to the Free Software Foundation, Inc.,
#    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.


#import os, sys
import locale
import gettext
from cal_path import get_lang_path


current_locale, encoding = locale.getdefaultlocale()
locale_path = get_lang_path()
if current_locale==None:
	print("No local language set assuming en_US")	
	current_locale="en_US"

language = gettext.translation ('gpvdm', locale_path, [current_locale] , fallback=True)
language.install()

def yes_no(a):
	if a.lower() in ("ja","yes", "true", "t", "1"):
		return True
	elif a.lower() in ("nein","no", "false", "f", "0"):
		return False
	else:
		return a