Skip to content

Add Hungarian translation - #115

Draft
pehsa wants to merge 4 commits into
blupi-games:masterfrom
pehsa:master
Draft

pehsa wants to merge 4 commits into
blupi-games:masterfrom
pehsa:master

Conversation

@pehsa

@pehsa pehsa commented Mar 12, 2024

Copy link
Copy Markdown

Adding initial hungarian translation to the game

  • Creating hu.po
  • Translating hu.po
  • Add hungarian language to event.cxx
  • Creating hu/stories.blp
  • Translating hu/stories.blp
  • Testing and error checking

@Skywalker13

Copy link
Copy Markdown
Member

Hi, Thank you

I review your PR asap.

@Skywalker13

Copy link
Copy Markdown
Member

Hello

I checked your work. It's very good. Nevertheless some changes are missing. You need these changes in order to enable the hungarian language in the settings panel.

image

diff --git a/src/event.cxx b/src/event.cxx
index 3220cd3..653ee75 100644
--- a/src/event.cxx
+++ b/src/event.cxx
@@ -1693,6 +1693,7 @@ CEvent::CEvent ()
     m_Languages.push_back (Language::ar);
     m_Languages.push_back (Language::es);
   }
+  m_Languages.push_back (Language::hu);
 
   this->m_LangStart = GetLocale ();
 
@@ -1716,6 +1717,8 @@ CEvent::CEvent ()
     m_Lang = m_Languages.begin () + 9;
   else if (this->m_LangStart == "es" && !(g_settingsOverload & SETTING_LEGACY))
     m_Lang = m_Languages.begin () + 10;
+  else if (this->m_LangStart == "hu")
+    m_Lang = m_Languages.begin () + 11;
   else
     m_Lang = m_Languages.begin ();
 
@@ -4216,6 +4219,8 @@ CEvent::GetStartLanguage ()
     return Language::ar;
   if (this->m_LangStart == "es" && !(g_settingsOverload & SETTING_LEGACY))
     return Language::es;
+  if (this->m_LangStart == "hu")
+    return Language::hu;
   return Language::en;
 }
 
@@ -4271,6 +4276,9 @@ CEvent::SetLanguage (Language lang)
   case Language::es:
     slang = "es";
     break;
+  case Language::hu:
+    slang = "hu";
+    break;
   }
 
   snprintf (env, sizeof (env), "LANGUAGE=%s", slang);
diff --git a/src/event.h b/src/event.h
index b9d4a41..f364b93 100644
--- a/src/event.h
+++ b/src/event.h
@@ -90,6 +90,7 @@ enum class Language {
   he    = 8,
   ar    = 9,
   es    = 10,
+  hu    = 11,
   end,
 };
 

Finally, the hu.po file is a little bit malformed but it's not fatal. It's not necessary that I provide the whole fixed hu.po file here. If you set properly the charset, then everything will going fine.

-"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Type: text/plain; charset=UTF-8\n"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants