Changeset 13 for trunk/UCore.pas


Ignore:
Timestamp:
Oct 5, 2019, 11:16:00 AM (5 years ago)
Author:
chronos
Message:
  • Added: Allow to change interface language in settings form.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UCore.pas

    r11 r13  
    118118    Game.Size := Point(ReadIntegerWithDefault('SizeX', 4), ReadIntegerWithDefault('SizeY', 4));
    119119    Game.AnimationDuration := ReadIntegerWithDefault('AnimationDuration', 30);
     120    if ValueExists('LanguageCode') then
     121      Translator1.Language := Translator1.Languages.SearchByCode(ReadStringWithDefault('LanguageCode', ''))
     122      else Translator1.Language := Translator1.Languages.SearchByCode('');
    120123  finally
    121124    Free;
     
    133136    WriteInteger('SizeY', Game.Size.Y);
    134137    WriteInteger('AnimationDuration', Game.AnimationDuration);
     138    if Assigned(Translator1.Language) and (Translator1.Language.Code <> '') then
     139      WriteString('LanguageCode', Translator1.Language.Code)
     140      else DeleteValue('LanguageCode');
    135141  finally
    136142    Free;
Note: See TracChangeset for help on using the changeset viewer.