Commit c26be84
Language settings
Changed files (4)
modifiedlibbirdfont/BirdFont.valamodifiedlibbirdfont/SettingsTab.valamodifiedlibbirdfont/ThemeTab.valamodifiedresources/icons.bf
Diff
@@ -497,7 +497,13 @@ public string t_ (string t) { #if ANDROID return t; #else- return _(t);+ string translate = Preferences.get ("translate");+ + if (translate == "" || translate == "true") {+ return _(t);+ } else {+ return t;+ } #endif } @@ -18,6 +18,8 @@ using Math; namespace BirdFont { public class SettingsTab : SettingsDisplay {++ string restart_message = "You need to restart the program in order to apply this setting."; public SettingsTab () { base ();@@ -141,6 +143,25 @@ public class SettingsTab : SettingsDisplay { DrawingTools.pen_tool.set_simplification_threshold (simplification_threshold.get_value ()); }); + Tool translate_ui = new Tool ("translate");+ translate_ui.select_action.connect((self) => {+ Preferences.set ("translate", @"true"); + ThemeTab.redraw_ui ();+ translate_ui.selected = true;+ MainWindow.show_dialog (new MessageDialog (restart_message));+ });+ + translate_ui.deselect_action.connect((self) => {+ Preferences.set ("translate", @"false");+ translate_ui.selected = false;+ MainWindow.show_dialog (new MessageDialog (restart_message));+ ThemeTab.redraw_ui ();+ });++ string translate_setting = Preferences.get ("translate");+ translate_ui.selected = translate_setting == "" || translate_setting == "true"; + tools.add (new SettingsItem (translate_ui, t_("Translate")));+ Tool themes = new Tool ("open_theme_tab"); themes.set_icon ("theme"); themes.select_action.connect((self) => {@@ -53,7 +53,6 @@ public class ThemeTab : SettingsDisplay { select_theme.select_action.connect((self) => { string theme_file = self.get_name ();- TabBar tb; Toolbox toolbox; Preferences.set ("theme", theme_file);@@ -76,17 +75,7 @@ public class ThemeTab : SettingsDisplay { e.redraw (); } - Toolbox.redraw_tool_box ();- - GlyphCanvas.redraw ();- - tb = MainWindow.get_tab_bar ();- tb.redraw (0, 0, tb.width, tb.height);- - OverViewItem.label_background = null;- OverViewItem.selected_label_background = null;- OverViewItem.label_background_no_menu = null;- OverViewItem.selected_label_background_no_menu = null;+ redraw_ui (); }); select_theme.set_icon ("theme");@@ -140,6 +129,22 @@ public class ThemeTab : SettingsDisplay { } } + public static void redraw_ui (){+ TabBar tb;+ + Toolbox.redraw_tool_box (); + + GlyphCanvas.redraw ();+ + tb = MainWindow.get_tab_bar ();+ tb.redraw (0, 0, tb.width, tb.height);+ + OverViewItem.label_background = null;+ OverViewItem.selected_label_background = null;+ OverViewItem.label_background_no_menu = null;+ OverViewItem.selected_label_background_no_menu = null; + }+ public static string get_label_from_file_name (string theme) { string label; @@ -1651,6 +1651,16 @@ GNU Lesser General Public License</copyright> </glyph> </collection> +<collection name="translate">+ <selected id="0"/>+ <glyph id="0" left="-28" right="28">+ <layer name= "Layer" visible="true">+ <path data="B -8.7490642589,49.3988532131 C -6.3869401212,50.3651767240 -4.3469238204,50.1504381663 -1.4479532876,48.9693760972 T C 1.2293855707,47.8786084141 3.0615564298,44.4598663798 -0.1595219398,43.9230199847 T C -3.3806003095,43.3861735897 -7.6753714690,47.6809447493 -8.7490642589,49.3988532131" />+ <path data="B -20.0228385528,33.5081999227 C -14.2248974874,34.8324210304 -6.1722015632,36.4071704554 -2.6290153565,37.4808632453 T C 0.9141708501,38.5545560352 8.3226511004,41.1314187310 9.6110824483,41.1314187310 T C 10.8995137961,41.1314187310 13.5837457707,41.7756344048 14.8721771186,40.3798337780 T C 16.1606084666,38.9840331512 17.3416705355,38.9840331511 8.7521282163,37.3734939663 T C 0.1625858972,35.7629547815 2.7394485929,36.0134830991 -0.2668912188,35.3334776655 M 2.3099714770,33.0787228069 C 1.5583865241,31.0387065061 0.1625858972,21.9123177920 -1.1258454507,18.1543930272 C 3.3120847475,15.2912122543 6.8194811945,11.2827591720 12.1879451440,9.5648507082 T C 17.7862147007,7.7734044500 21.5648621756,7.4890446477 26.2533206915,6.4511416175 C 22.4953959270,4.3037560377 23.7838272747,4.6258638747 13.2616379339,3.5521710848 T C 8.0179209976,3.0170979280 2.5247100350,11.4974977300 -2.8437539145,15.4701610526 C -3.7027081464,13.7522525888 -6.2541544206,11.0696298246 -10.4669727228,9.3501121502 T C -15.7280673932,7.2027265704 -22.0628548536,7.0953572913 -25.3913025023,7.6322036864 C -20.8102132654,9.1353735921 -15.2988717451,10.5981041010 -13.6880510924,11.6048670090 T C -10.2522341648,13.7522525888 -7.0311557951,16.2217460054 -5.5279858892,19.2280858171 M -12.6143583025,26.4218275094 M -15.8354366722,28.0323666944 C -15.7280673932,28.3186847717 -14.6543746033,29.3207980421 -13.0438354185,29.4281673211 T C -11.8850313613,29.5054209250 -11.3259269547,28.6765823683 -9.2859106539,26.5291967884 T C -8.2992874836,25.4906460827 -5.4206166103,22.9860105819 -4.5616623783,21.8049485130 C -3.7027081464,23.7375955348 -3.4879695884,24.8112883247 -2.9511231935,27.2807817413 T C -2.0107080383,31.6066914556 -2.4142767986,34.7966312706 -3.4879695884,35.1187391077 M -15.2985902773,32.4345071328 C -16.4080728268,32.3271378538 -18.4122993678,31.6829221800 -18.6270379259,32.1123992960 T C -18.8417764839,32.5418764118 -19.5575716772,33.0429330471 -20.0228385528,33.5081999227" />+ </layer>+ </glyph>+</collection>+ <collection name="ttf_units"> <selected id="1"/> <glyph id="1" left="-28" right="33.862433862433868">@@ -1883,6 +1893,7 @@ GNU Lesser General Public License</copyright> <ligature sequence="h e l p _ l i n e s" replacement="help_lines"/> <ligature sequence="l e f t _ a r r o w" replacement="left_arrow"/> <ligature sequence="c l o s e _ p a t h" replacement="close_path"/>+<ligature sequence="t r a n s l a t e" replacement="translate"/> <ligature sequence="t r a n s f o r m" replacement="transform"/> <ligature sequence="a d d _ l a y e r" replacement="add_layer"/> <ligature sequence="o p e n _ f o n t" replacement="open_font"/>