Commit 878ff9c
translations on android
Changed files (7)
modifiedbirdfont/Main.valamodifiedlibbirdfont/BirdFont.valamodifiedlibbirdfont/GlyphBackgroundImage.valamodifiedlibbirdfont/Icons.valamodifiedlibbirdfont/MainWindow.valamodifiedlibbirdfont/SearchPaths.valamodifiedlibbirdfont/TabBar.vala
Diff
@@ -17,8 +17,6 @@ using BirdFont; -const string GETTEXT_PACKAGE = "birdfont"; - void parse_gtk_rc () { File f = FontDisplay.find_file ("layout", "birdfont.rc"); Gtk.rc_parse ((!) f.get_path ());@@ -85,3 +83,4 @@ public static int main (string[] arg) { return 0; } +@@ -12,7 +12,7 @@ Lesser General Public License for more details. */ using BirdFont;-const string GETTEXT_PACKAGE = "birdfont"; +public const string GETTEXT_PACKAGE = "birdfont"; namespace BirdFont { @@ -289,7 +289,7 @@ public class BirdFont { } } - printd ("fatal");+ printd ("init fatal warnings"); if (fatal_wanings) { LogLevelFlags levels = LogLevelFlags.LEVEL_ERROR | LogLevelFlags.LEVEL_CRITICAL | LogLevelFlags.LEVEL_WARNING; Log.set_handler (null, levels, fatal_warning);@@ -483,14 +483,9 @@ void printd (string s) { #endif } -#if ANDROID-string t_ (string t) {- return t;-}-#else+/** Translate string */ string t_ (string t) { return _(t); }-#endif }@@ -110,10 +110,8 @@ public class GlyphBackgroundImage { } if (background_image == null) {-#if !ANDROID // FIXME background_image = new ImageSurface.from_png (path); original_image = new ImageSurface.from_png (path);-#endif } return (!) background_image;@@ -19,9 +19,6 @@ using Cairo; public class Icons { public static ImageSurface? get_icon (string? name) {-#if ANDROID // FIXME:- return null;-#else ImageSurface? img = null; File f; @@ -40,7 +37,6 @@ public class Icons { img = new ImageSurface.from_png ((!)f.get_path ()); return img;-#endif } public static File find_icon (string name) {@@ -47,6 +47,7 @@ public class MainWindow { } public static void open_recent_files_tab () { + // FIXME: do not idle IdleSource idle = new IdleSource (); tabs.add_unique_tab (file_tab); idle.set_callback (() => { @@ -17,10 +17,21 @@ namespace BirdFont { /** Look for files in default folders on different operating systems. */ public class SearchPaths { + private static string resources_folder = "";+ public static File find_file (string? dir, string name) { File f; string d = (dir == null) ? "" : (!) dir; + printd ("Looking for: ");+ printd (resources_folder + "/" + d + "/" + name);++ f = get_file (resources_folder + "/" + d + "/", name);+ if (likely (f.query_exists ())) return f;+ + f = get_file (resources_folder + "/", name + "/");+ if (likely (f.query_exists ())) return f;+ f = get_file (BirdFont.exec_path + "/" + d + "/", name); if (likely (f.query_exists ())) return f; @@ -59,9 +70,6 @@ public class SearchPaths { f = get_file (@"$PREFIX/share/birdfont/" + d + "/", name); if (likely (f.query_exists ())) return f;-- f = get_file ("/usr/share/birdfont/" + d + "/", name);- if (likely (f.query_exists ())) return f; warning (@"Did not find file $name in $d"); @@ -153,6 +161,10 @@ public class SearchPaths { File f = File.new_for_path (file); return f.query_exists (); }++ public static void set_resources_folder (string res) {+ resources_folder = res;+ } } }@@ -51,7 +51,7 @@ public class TabBar : GLib.Object { ImageSurface to_previous_tab; public TabBar () {- // tabs = new List<Tab> ();+ tabs = new List<Tab> (); tab1_left = Icons.get_icon ("tab1_left.png"); tab1_right = Icons.get_icon ("tab1_right.png");@@ -68,7 +68,7 @@ public class TabBar : GLib.Object { to_previous_tab = (!) Icons.get_icon ("previous_tab.png"); if (is_null (next_tab)) {- warning ("Next tab is null");+ warning ("Tab icon is null"); } }