2011-02-23 10:52:22 +00:00
|
|
|
/*
|
2009-01-29 05:19:27 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* 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,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-01-29 05:19:27 +00:00
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2008 Blender Foundation.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): Blender Foundation.
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
2011-02-27 20:42:42 +00:00
|
|
|
/** \file blender/blenfont/intern/blf_lang.c
|
|
|
|
|
* \ingroup blf
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2009-01-29 05:19:27 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
2011-12-26 14:52:36 +00:00
|
|
|
#include "BKE_global.h"
|
|
|
|
|
|
2011-02-13 10:52:18 +00:00
|
|
|
#include "BLF_api.h"
|
|
|
|
|
|
2011-11-14 16:05:44 +00:00
|
|
|
#include "BLF_translation.h" /* own include */
|
|
|
|
|
|
2011-09-26 10:35:47 +00:00
|
|
|
#ifdef WITH_INTERNATIONAL
|
2009-02-17 16:56:29 +00:00
|
|
|
|
2009-03-31 21:19:23 +00:00
|
|
|
#include <locale.h>
|
2011-09-15 13:20:18 +00:00
|
|
|
|
2012-05-11 16:11:52 +00:00
|
|
|
#if defined(_WIN32)
|
2011-09-15 13:20:18 +00:00
|
|
|
#include <windows.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2011-06-24 03:30:50 +00:00
|
|
|
#include "libintl.h"
|
2009-02-17 16:56:29 +00:00
|
|
|
|
2011-07-22 14:14:28 +00:00
|
|
|
#include "DNA_userdef_types.h"
|
2009-01-29 05:19:27 +00:00
|
|
|
|
|
|
|
|
#include "DNA_listBase.h"
|
2009-02-17 16:56:29 +00:00
|
|
|
#include "DNA_vec_types.h"
|
2009-01-29 05:19:27 +00:00
|
|
|
|
2011-02-13 03:21:27 +00:00
|
|
|
#include "MEM_guardedalloc.h"
|
2011-01-07 19:18:31 +00:00
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
#include "BLI_linklist.h" /* linknode */
|
2009-01-29 05:19:27 +00:00
|
|
|
#include "BLI_string.h"
|
2011-10-21 11:33:18 +00:00
|
|
|
#include "BLI_utildefines.h"
|
2011-02-13 03:21:27 +00:00
|
|
|
#include "BLI_path_util.h"
|
2009-01-29 05:19:27 +00:00
|
|
|
|
2009-03-31 21:19:23 +00:00
|
|
|
#define SYSTEM_ENCODING_DEFAULT "UTF-8"
|
|
|
|
|
#define FONT_SIZE_DEFAULT 12
|
2009-01-29 05:19:27 +00:00
|
|
|
|
2009-03-31 21:19:23 +00:00
|
|
|
/* locale options. */
|
2011-02-13 10:52:18 +00:00
|
|
|
static char global_messagepath[1024];
|
|
|
|
|
static char global_language[32];
|
|
|
|
|
static char global_encoding_name[32];
|
2009-01-29 05:19:27 +00:00
|
|
|
|
2011-07-22 14:14:28 +00:00
|
|
|
/* map from the rna_userdef.c:rna_def_userdef_system(BlenderRNA *brna):language_items */
|
2011-09-15 13:02:37 +00:00
|
|
|
static const char *locales[] = {
|
2011-09-06 05:18:02 +00:00
|
|
|
"", "",
|
|
|
|
|
"english", "en_US",
|
|
|
|
|
"japanese", "ja_JP",
|
|
|
|
|
"dutch", "nl_NL",
|
|
|
|
|
"italian", "it_IT",
|
|
|
|
|
"german", "de_DE",
|
|
|
|
|
"finnish", "fi_FI",
|
|
|
|
|
"swedish", "sv_SE",
|
|
|
|
|
"french", "fr_FR",
|
2011-11-18 09:16:29 +00:00
|
|
|
"spanish", "es",
|
2011-09-06 05:18:02 +00:00
|
|
|
"catalan", "ca_AD",
|
|
|
|
|
"czech", "cs_CZ",
|
2012-09-05 18:35:22 +00:00
|
|
|
"portuguese", "pt_PT",
|
2012-05-11 16:11:52 +00:00
|
|
|
#if defined(_WIN32) && !defined(FREE_WINDOWS)
|
2011-09-21 15:07:19 +00:00
|
|
|
"Chinese (Simplified)_China.1252", "zh_CN",
|
|
|
|
|
"Chinese (Traditional)_China.1252", "zh_TW",
|
2011-12-26 14:52:36 +00:00
|
|
|
#else
|
|
|
|
|
"chs", "zh_CN",
|
|
|
|
|
"cht", "zh_TW",
|
|
|
|
|
#endif
|
2011-09-06 05:18:02 +00:00
|
|
|
"russian", "ru_RU",
|
|
|
|
|
"croatian", "hr_HR",
|
2011-12-23 13:36:07 +00:00
|
|
|
"serbian", "sr_RS",
|
2011-09-06 05:18:02 +00:00
|
|
|
"ukrainian", "uk_UA",
|
|
|
|
|
"polish", "pl_PL",
|
|
|
|
|
"romanian", "ro_RO",
|
|
|
|
|
"arabic", "ar_EG",
|
|
|
|
|
"bulgarian", "bg_BG",
|
|
|
|
|
"greek", "el_GR",
|
2011-09-17 20:50:22 +00:00
|
|
|
"korean", "ko_KR",
|
|
|
|
|
"nepali", "ne_NP",
|
2012-02-17 12:27:58 +00:00
|
|
|
"persian", "fa_IR",
|
2011-12-21 11:56:42 +00:00
|
|
|
"indonesian", "id_ID",
|
2011-12-23 13:36:07 +00:00
|
|
|
"serbian (latin)", "sr_RS@latin",
|
2012-03-31 14:22:22 +00:00
|
|
|
"kyrgyz", "ky_KG",
|
2012-04-05 09:13:32 +00:00
|
|
|
"turkish", "tr_TR",
|
2012-04-30 07:43:04 +00:00
|
|
|
"hungarian", "hu_HU",
|
2012-09-05 18:35:22 +00:00
|
|
|
"brazilian portuguese", "pt_BR",
|
2012-09-07 16:06:58 +00:00
|
|
|
"hebrew", "he_IL",
|
2011-07-22 14:14:28 +00:00
|
|
|
};
|
2009-01-29 05:19:27 +00:00
|
|
|
|
2010-07-04 15:35:23 +00:00
|
|
|
void BLF_lang_init(void)
|
2009-01-29 05:19:27 +00:00
|
|
|
{
|
2012-03-12 09:22:16 +00:00
|
|
|
char *messagepath = BLI_get_folder(BLENDER_DATAFILES, "locale");
|
UI translation from inside Blender UI: first part.
This commit reshapes a bit runtime button info getter, by adding a new uiButGetStrInfo() which accepts a variable number of uiStringInfo parameters, and tries to fill them with the requested strings, for the given button (label, tip, context, RNA identifier, keymap, etc.). Currently used mostly by existing ui_tooltip_create(), and new UI_OT_edittranslation_init operator.
It also adds a few getters (to get RNA i18n context, and current language iso code).
Finally, it adds to C operators needed for the py ui_translation addon:
*UI_OT_edittranslation_init, which gathers requested data and launch the py operator.
*UI_OT_reloadtranslation, which forces a full reload of the whole UI translation (including rechecking the directory containing mo files).
For the first operator to work, it also adds a new user preferences path: i18n_branches_directory, to point to the /branch part of a bf-translation checkout.
2012-07-09 14:25:35 +00:00
|
|
|
/* printf("%s\n", messagepath);*/
|
|
|
|
|
|
2010-07-04 15:35:23 +00:00
|
|
|
BLI_strncpy(global_encoding_name, SYSTEM_ENCODING_DEFAULT, sizeof(global_encoding_name));
|
2009-09-24 07:03:18 +00:00
|
|
|
|
2011-10-21 08:16:15 +00:00
|
|
|
if (messagepath) {
|
2010-07-04 15:35:23 +00:00
|
|
|
BLI_strncpy(global_messagepath, messagepath, sizeof(global_messagepath));
|
2011-10-21 08:16:15 +00:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
printf("%s: 'locale' data path for translations not found, continuing\n", __func__);
|
2012-03-12 09:22:16 +00:00
|
|
|
global_messagepath[0] = '\0';
|
2011-10-21 08:16:15 +00:00
|
|
|
}
|
2011-02-22 12:01:57 +00:00
|
|
|
|
2009-09-24 07:03:18 +00:00
|
|
|
}
|
2010-07-04 15:35:23 +00:00
|
|
|
|
2011-12-26 14:52:36 +00:00
|
|
|
/* get LANG/LANGUAGE environment variable */
|
2012-09-15 07:31:17 +00:00
|
|
|
static void get_language_variable(const char *varname, char *var, const size_t maxlen)
|
2011-12-26 14:52:36 +00:00
|
|
|
{
|
2012-03-12 09:22:16 +00:00
|
|
|
char *env = getenv(varname);
|
2011-12-26 14:52:36 +00:00
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
if (env) {
|
2011-12-26 14:52:36 +00:00
|
|
|
char *s;
|
|
|
|
|
|
|
|
|
|
/* store defaul locale */
|
|
|
|
|
BLI_strncpy(var, env, maxlen);
|
|
|
|
|
|
|
|
|
|
/* use first language as default */
|
2012-03-12 09:22:16 +00:00
|
|
|
s = strchr(var, ':');
|
|
|
|
|
if (s)
|
|
|
|
|
s[0] = 0;
|
2011-12-26 14:52:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* get language to be used based on locale(which might be empty when using default language) and
|
|
|
|
|
* LANG environment variable
|
|
|
|
|
*/
|
2012-09-15 07:31:17 +00:00
|
|
|
static void get_language(const char *locale, const char *lang, char *language, const size_t maxlen)
|
2011-12-26 14:52:36 +00:00
|
|
|
{
|
2012-03-12 09:22:16 +00:00
|
|
|
if (locale[0]) {
|
2011-12-26 14:52:36 +00:00
|
|
|
BLI_strncpy(language, locale, maxlen);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
char *s;
|
|
|
|
|
|
|
|
|
|
BLI_strncpy(language, lang, maxlen);
|
|
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
s = strchr(language, '.');
|
|
|
|
|
if (s)
|
|
|
|
|
s[0] = 0;
|
2011-12-26 14:52:36 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-22 12:01:57 +00:00
|
|
|
/* XXX WARNING!!! IN osx somehow the previous function call jumps in this one??? (ton, ppc) */
|
2009-09-24 07:03:18 +00:00
|
|
|
void BLF_lang_set(const char *str)
|
|
|
|
|
{
|
2011-07-22 14:14:28 +00:00
|
|
|
char *locreturn;
|
2011-09-15 13:02:37 +00:00
|
|
|
const char *short_locale;
|
2012-03-12 09:22:16 +00:00
|
|
|
int ok = 1;
|
2011-12-26 14:52:36 +00:00
|
|
|
const char *long_locale = locales[2 * U.language];
|
2011-08-31 07:31:02 +00:00
|
|
|
|
2012-05-11 16:11:52 +00:00
|
|
|
if ((U.transopts & USER_DOTRANSLATE) == 0)
|
2011-09-15 13:20:18 +00:00
|
|
|
return;
|
|
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
if (str)
|
2011-08-31 07:31:02 +00:00
|
|
|
short_locale = str;
|
|
|
|
|
else
|
2012-05-11 16:11:52 +00:00
|
|
|
short_locale = locales[2 * U.language + 1];
|
2011-08-31 07:31:02 +00:00
|
|
|
|
2012-05-11 16:11:52 +00:00
|
|
|
#if defined(_WIN32) && !defined(FREE_WINDOWS)
|
2012-03-12 09:22:16 +00:00
|
|
|
if (short_locale) {
|
2011-09-06 05:18:02 +00:00
|
|
|
char *envStr;
|
2011-09-15 13:20:18 +00:00
|
|
|
|
2012-05-11 16:11:52 +00:00
|
|
|
if (U.language == 0) /* use system setting */
|
2012-04-29 17:11:40 +00:00
|
|
|
envStr = BLI_sprintfN("LANG=%s", getenv("LANG"));
|
2011-09-06 05:18:02 +00:00
|
|
|
else
|
2012-04-29 17:11:40 +00:00
|
|
|
envStr = BLI_sprintfN("LANG=%s", short_locale);
|
2011-09-15 13:20:18 +00:00
|
|
|
|
2011-09-06 05:18:02 +00:00
|
|
|
gettext_putenv(envStr);
|
|
|
|
|
MEM_freeN(envStr);
|
2011-08-12 13:43:21 +00:00
|
|
|
}
|
2011-09-15 13:20:18 +00:00
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
locreturn = setlocale(LC_ALL, long_locale);
|
2011-09-15 13:20:18 +00:00
|
|
|
|
2011-07-25 17:05:43 +00:00
|
|
|
if (locreturn == NULL) {
|
2012-03-31 00:59:17 +00:00
|
|
|
if (G.debug & G_DEBUG)
|
2011-12-26 14:52:36 +00:00
|
|
|
printf("Could not change locale to %s\n", long_locale);
|
|
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
ok = 0;
|
2011-08-31 07:31:02 +00:00
|
|
|
}
|
|
|
|
|
#else
|
2011-09-06 05:18:02 +00:00
|
|
|
{
|
2012-05-11 16:11:52 +00:00
|
|
|
static char default_lang[64] = "\0";
|
|
|
|
|
static char default_language[64] = "\0";
|
2011-09-06 05:18:02 +00:00
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
if (default_lang[0] == 0)
|
2011-12-26 14:52:36 +00:00
|
|
|
get_language_variable("LANG", default_lang, sizeof(default_lang));
|
2011-09-17 20:50:22 +00:00
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
if (default_language[0] == 0)
|
2011-12-26 14:52:36 +00:00
|
|
|
get_language_variable("LANGUAGE", default_language, sizeof(default_language));
|
2011-09-17 20:50:22 +00:00
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
if (short_locale[0]) {
|
2012-03-31 00:59:17 +00:00
|
|
|
if (G.debug & G_DEBUG)
|
2011-12-26 14:52:36 +00:00
|
|
|
printf("Setting LANG= and LANGUAGE to %s\n", short_locale);
|
2011-09-17 20:50:22 +00:00
|
|
|
|
2011-12-26 14:52:36 +00:00
|
|
|
BLI_setenv("LANG", short_locale);
|
|
|
|
|
BLI_setenv("LANGUAGE", short_locale);
|
2011-09-17 20:50:22 +00:00
|
|
|
}
|
2011-12-26 14:52:36 +00:00
|
|
|
else {
|
2012-03-31 00:59:17 +00:00
|
|
|
if (G.debug & G_DEBUG)
|
2011-12-26 14:52:36 +00:00
|
|
|
printf("Setting LANG=%s and LANGUAGE=%s\n", default_lang, default_language);
|
2011-09-15 13:20:18 +00:00
|
|
|
|
2011-12-26 14:52:36 +00:00
|
|
|
BLI_setenv("LANG", default_lang);
|
|
|
|
|
BLI_setenv("LANGUAGE", default_language);
|
|
|
|
|
}
|
2011-09-15 13:20:18 +00:00
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
locreturn = setlocale(LC_ALL, short_locale);
|
2009-01-29 05:19:27 +00:00
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
if (locreturn == NULL) {
|
|
|
|
|
char *short_locale_utf8 = NULL;
|
2011-07-22 14:14:28 +00:00
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
if (short_locale[0]) {
|
|
|
|
|
short_locale_utf8 = BLI_sprintfN("%s.UTF-8", short_locale);
|
|
|
|
|
locreturn = setlocale(LC_ALL, short_locale_utf8);
|
2011-12-26 14:52:36 +00:00
|
|
|
}
|
2011-09-15 13:20:18 +00:00
|
|
|
|
|
|
|
|
if (locreturn == NULL) {
|
2011-12-26 14:52:36 +00:00
|
|
|
char language[65];
|
|
|
|
|
|
|
|
|
|
get_language(long_locale, default_lang, language, sizeof(language));
|
|
|
|
|
|
2012-03-31 00:59:17 +00:00
|
|
|
if (G.debug & G_DEBUG) {
|
2012-03-12 09:22:16 +00:00
|
|
|
if (short_locale[0])
|
2011-12-26 14:52:36 +00:00
|
|
|
printf("Could not change locale to %s nor %s\n", short_locale, short_locale_utf8);
|
|
|
|
|
else
|
|
|
|
|
printf("Could not reset locale\n");
|
|
|
|
|
|
|
|
|
|
printf("Fallback to LANG=%s and LANGUAGE=%s\n", default_lang, language);
|
|
|
|
|
}
|
2011-12-22 19:09:21 +00:00
|
|
|
|
|
|
|
|
/* fallback to default settings */
|
2011-12-26 14:52:36 +00:00
|
|
|
BLI_setenv("LANG", default_lang);
|
|
|
|
|
BLI_setenv("LANGUAGE", language);
|
|
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
locreturn = setlocale(LC_ALL, "");
|
2011-12-22 19:09:21 +00:00
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
ok = 0;
|
2011-09-15 13:20:18 +00:00
|
|
|
}
|
|
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
if (short_locale_utf8)
|
2011-12-26 14:52:36 +00:00
|
|
|
MEM_freeN(short_locale_utf8);
|
2011-09-15 13:20:18 +00:00
|
|
|
}
|
2011-08-31 07:31:02 +00:00
|
|
|
}
|
|
|
|
|
#endif
|
2011-09-15 13:20:18 +00:00
|
|
|
|
2012-03-12 09:22:16 +00:00
|
|
|
if (ok) {
|
|
|
|
|
/*printf("Change locale to %s\n", locreturn ); */
|
2011-08-31 07:31:02 +00:00
|
|
|
BLI_strncpy(global_language, locreturn, sizeof(global_language));
|
2011-07-25 17:05:43 +00:00
|
|
|
}
|
2011-09-15 13:20:18 +00:00
|
|
|
|
2011-07-25 17:05:43 +00:00
|
|
|
setlocale(LC_NUMERIC, "C");
|
|
|
|
|
|
2011-12-22 18:25:59 +00:00
|
|
|
textdomain(TEXT_DOMAIN_NAME);
|
|
|
|
|
bindtextdomain(TEXT_DOMAIN_NAME, global_messagepath);
|
|
|
|
|
bind_textdomain_codeset(TEXT_DOMAIN_NAME, global_encoding_name);
|
2009-01-29 05:19:27 +00:00
|
|
|
}
|
|
|
|
|
|
UI translation from inside Blender UI: first part.
This commit reshapes a bit runtime button info getter, by adding a new uiButGetStrInfo() which accepts a variable number of uiStringInfo parameters, and tries to fill them with the requested strings, for the given button (label, tip, context, RNA identifier, keymap, etc.). Currently used mostly by existing ui_tooltip_create(), and new UI_OT_edittranslation_init operator.
It also adds a few getters (to get RNA i18n context, and current language iso code).
Finally, it adds to C operators needed for the py ui_translation addon:
*UI_OT_edittranslation_init, which gathers requested data and launch the py operator.
*UI_OT_reloadtranslation, which forces a full reload of the whole UI translation (including rechecking the directory containing mo files).
For the first operator to work, it also adds a new user preferences path: i18n_branches_directory, to point to the /branch part of a bf-translation checkout.
2012-07-09 14:25:35 +00:00
|
|
|
const char *BLF_lang_get(void)
|
|
|
|
|
{
|
|
|
|
|
return locales[2 * U.language + 1];
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-17 12:05:09 +00:00
|
|
|
void BLF_lang_encoding(const char *str)
|
2009-01-29 05:19:27 +00:00
|
|
|
{
|
2011-02-13 03:21:27 +00:00
|
|
|
BLI_strncpy(global_encoding_name, str, sizeof(global_encoding_name));
|
2011-12-22 18:25:59 +00:00
|
|
|
/* bind_textdomain_codeset(TEXT_DOMAIN_NAME, encoding_name); */
|
2009-03-31 21:19:23 +00:00
|
|
|
}
|
|
|
|
|
|
2011-09-26 10:35:47 +00:00
|
|
|
#else /* ! WITH_INTERNATIONAL */
|
2009-03-31 21:19:23 +00:00
|
|
|
|
|
|
|
|
void BLF_lang_init(void)
|
|
|
|
|
{
|
|
|
|
|
return;
|
2009-01-29 05:19:27 +00:00
|
|
|
}
|
2009-03-31 21:19:23 +00:00
|
|
|
|
2011-02-17 12:05:09 +00:00
|
|
|
void BLF_lang_encoding(const char *str)
|
2009-03-31 21:19:23 +00:00
|
|
|
{
|
2010-10-16 14:32:17 +00:00
|
|
|
(void)str;
|
2009-03-31 21:19:23 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2011-02-13 12:50:40 +00:00
|
|
|
void BLF_lang_set(const char *str)
|
2009-03-31 21:19:23 +00:00
|
|
|
{
|
2010-10-16 14:32:17 +00:00
|
|
|
(void)str;
|
2009-03-31 21:19:23 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
UI translation from inside Blender UI: first part.
This commit reshapes a bit runtime button info getter, by adding a new uiButGetStrInfo() which accepts a variable number of uiStringInfo parameters, and tries to fill them with the requested strings, for the given button (label, tip, context, RNA identifier, keymap, etc.). Currently used mostly by existing ui_tooltip_create(), and new UI_OT_edittranslation_init operator.
It also adds a few getters (to get RNA i18n context, and current language iso code).
Finally, it adds to C operators needed for the py ui_translation addon:
*UI_OT_edittranslation_init, which gathers requested data and launch the py operator.
*UI_OT_reloadtranslation, which forces a full reload of the whole UI translation (including rechecking the directory containing mo files).
For the first operator to work, it also adds a new user preferences path: i18n_branches_directory, to point to the /branch part of a bf-translation checkout.
2012-07-09 14:25:35 +00:00
|
|
|
const char *BLF_lang_get(void)
|
|
|
|
|
{
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
2011-09-26 10:35:47 +00:00
|
|
|
#endif /* WITH_INTERNATIONAL */
|