EN as additional search language in the editor

Signed-off-by: map-per <map-per@gmx.de>
This commit is contained in:
map-per 2024-12-04 08:15:56 +01:00 committed by Viktor Havaka
parent 6a2e58168d
commit 20aa24a74b
2 changed files with 9 additions and 5 deletions

View file

@ -406,8 +406,10 @@ Java_app_organicmaps_editor_Editor_nativeGetAllCreatableFeatureTypes(JNIEnv * en
jstring jLang)
{
std::string const & lang = jni::ToNativeString(env, jLang);
GetFeatureCategories().AddLanguage(lang);
return jni::ToJavaStringArray(env, GetFeatureCategories().GetAllCreatableTypeNames());
auto & categories = GetFeatureCategories();
categories.AddLanguage(lang);
categories.AddLanguage("en");
return jni::ToJavaStringArray(env, categories.GetAllCreatableTypeNames());
}
JNIEXPORT jobjectArray JNICALL
@ -416,9 +418,10 @@ Java_app_organicmaps_editor_Editor_nativeSearchCreatableFeatureTypes(JNIEnv * en
jstring jLang)
{
std::string const & lang = jni::ToNativeString(env, jLang);
GetFeatureCategories().AddLanguage(lang);
return jni::ToJavaStringArray(env,
GetFeatureCategories().Search(jni::ToNativeString(env, query)));
auto & categories = GetFeatureCategories();
categories.AddLanguage(lang);
categories.AddLanguage("en");
return jni::ToJavaStringArray(env, categories.Search(jni::ToNativeString(env, query)));
}
JNIEXPORT jobjectArray JNICALL

View file

@ -50,6 +50,7 @@ std::string locale()
{
m_categories = GetFramework().GetEditorCategories();
m_categories.AddLanguage(locale());
m_categories.AddLanguage("en");
auto const & types = m_categories.GetAllCreatableTypeNames();
m_categoriesList.reserve(types.size());