summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2010-04-03 08:27:33 +0200
committerGraeme Geldenhuys <graemeg@gmail.com>2010-04-03 08:27:33 +0200
commite35f383a8026de6a832bddc72abab0496361fb29 (patch)
tree59036ac4c90f527b573b64be8b5e5bf8f15973f1 /src/corelib
parent4ea8ef825eb74e49337316bbd2c3c57c06b6f0e8 (diff)
downloadfpGUI-e35f383a8026de6a832bddc72abab0496361fb29.tar.xz
Introduced new method fpgMatchLocale to compare passed-in
locale to what fpGUI detected at startup.
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/fpg_translations.pas15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/corelib/fpg_translations.pas b/src/corelib/fpg_translations.pas
index f206edf1..31aeb360 100644
--- a/src/corelib/fpg_translations.pas
+++ b/src/corelib/fpg_translations.pas
@@ -26,6 +26,7 @@ interface
uses
Classes
,SysUtils
+ ,fpg_base
;
@@ -57,6 +58,7 @@ type
procedure TranslateResourceStrings(const BaseAppName, BaseDirectory, CustomLang: string);
+function fpgMatchLocale(const ALanguageID: TfpgString): boolean;
implementation
@@ -65,6 +67,7 @@ uses
GetText
,fpg_pofiles
,fpg_utils
+ ,fpg_main
;
@@ -166,6 +169,18 @@ begin
ALanguageID := Copy(ALanguageID, 0, lpos-1);
end;
+function fpgMatchLocale(const ALanguageID: TfpgString): boolean;
+var
+ s: TfpgString;
+begin
+ s := ALanguageID;
+ FixLanguageIDs(s);
+ Result := s = SystemLanguageID1;
+ if not Result then
+ Result := s = SystemLanguageID2;
+end;
+
+
{ TTranslationList }
function TTranslationList.GetItems(Index: integer): TTranslation;