Run './waf build'
-You can now run Midori from _build_/default/midori
+You can now run Midori from the build folder like so
+
+'./waf build --run'
+
+This is a convenience that will load extensions as well as
+localizations from the build folder.
You can install it with './waf install'
+++ Debugging Midori +++
-Run './waf configure -d debug' from the Midori folder.
+Run './waf configure -d full' from the Midori folder.
Run './waf build'
msgfmt -c --check-accelerators=_ aa.po
-To test your changes, make sure you install Midori:
+To test your changes, run Midori like so:
-./waf install
+./waf build --run
-And of course you can uninstall it again after testing:
-
-./waf uninstall
+This is a convenience command that will setup localization in
+the build folder so you don't need to install translations.
To run Midori in a particular language, run it like this:
-LANG=fr_FR.utf8 midori
+LANG=fr_FR.utf8 ./waf build --run
As a general rule, your localization should be based off of the
-current state of the git repository.
+current git repository or the latest midori.pot in git.
Some strings have comments, starting with 'i18n', which are meant
to describe the role of a string to translators.
#endif
#if ENABLE_NLS
- bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ setlocale (LC_ALL, "");
+ if (g_getenv ("NLSPATH"))
+ bindtextdomain (GETTEXT_PACKAGE, g_getenv ("NLSPATH"));
+ else
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
#endif
if conf.env['INTLTOOL'] and conf.env['POCOM']:
nls = 'yes'
conf.define ('ENABLE_NLS', 1)
- conf.define ('MIDORI_LOCALEDIR', 'LOCALEDIR', 0)
else:
option_checkfatal ('nls', 'localization')
nls = 'N/A'
Utils.pprint ('RED', "Make sure intltool is installed.")
os.chdir ('..')
elif Options.options.run:
+ def mkdir (path):
+ if not os.access (path, os.F_OK):
+ os.mkdir (path)
+
folder = os.path.dirname (Build.bld.env['waf_config_files'][0])
try:
+ ext = 'MIDORI_EXTENSION_PATH=' + folder + os.sep + 'extensions'
+ nls = 'NLSPATH=' + folder + os.sep + 'po'
+ lang = os.environ['LANG']
+ try:
+ for lang in os.listdir (folder + os.sep + 'po'):
+ if lang[3:] == 'mo':
+ lang = lang[:-3]
+ else:
+ continue
+ mkdir (folder + os.sep + 'po' + os.sep + lang)
+ mkdir (folder + os.sep + 'po' + os.sep + lang + \
+ os.sep + 'LC_MESSAGES')
+ os.symlink (folder + os.sep + 'po' + os.sep + lang + '.mo',
+ folder + os.sep + 'po' + os.sep + lang + os.sep + \
+ 'LC_MESSAGES' + os.sep + APPNAME + '.mo')
+ except:
+ pass
command = folder + os.sep + APPNAME + os.sep + APPNAME
- Utils.exec_command ('MIDORI_EXTENSION_PATH=' + folder + \
- os.sep + 'extensions' + ' ' + command)
+ print ext + ' ' + nls + ' ' + command
+ Utils.exec_command (ext + ' ' + nls + ' ' + command)
except:
Utils.pprint ('RED', "Failed to run application.")