Merge lp:~quam-plures-core/quam-plures/miscfiles_rename-locales-dir into lp:quam-plures/misc

Proposed by Tilman Blumenbach
Status: Merged
Merged at revision: 8
Proposed branch: lp:~quam-plures-core/quam-plures/miscfiles_rename-locales-dir
Merge into: lp:quam-plures/misc
Diff against target: 91 lines (+12/-12)
3 files modified
gettext/xg.php (+10/-10)
tutorials/templates/examples/Item__is_featured.sample.php (+1/-1)
tutorials/templates/examples/Item__is_intro.sample.php (+1/-1)
To merge this branch: bzr merge lp:~quam-plures-core/quam-plures/miscfiles_rename-locales-dir
Reviewer Review Type Date Requested Status
EdB Approve
Review via email: mp+32031@code.launchpad.net

Description of the change

This branch modifies the gettext/xg.php script to work with the new i18n directory structure (e. g. locales/ is now qp_locales/ etc.).

To post a comment you must log in.
Revision history for this message
EdB (edb) wrote :

Don't know how to test but looking at everything makes me think "wow this is GREAT!". Will merge now even though it kinda goes with the other 'rename locales' branch.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'gettext/xg.php'
2--- gettext/xg.php 2010-05-02 19:39:44 +0000
3+++ gettext/xg.php 2010-08-07 12:14:42 +0000
4@@ -37,7 +37,7 @@
5
6 function echo_usage()
7 {
8- global $argv, $app_name, $my_basename, $_app_root;
9+ global $argv, $app_name, $my_basename, $_app_root, $locales_subdir;
10
11 echo 'Usage: ', "\n";
12 echo ' ', $my_basename, ' [-b <app_root>] <CORE|CWD> [extract]', "\n";
13@@ -46,14 +46,14 @@
14 echo 'CORE: work on the core application.', "\n";
15 echo 'CWD : work on current working directory (plugin mode).', "\n";
16 echo "\n";
17- echo 'By default, the translatable strings get extracted into locales/messages.POT.', "\n";
18+ echo 'By default, the translatable strings get extracted into ', $locales_subdir, 'messages.pot.', "\n";
19 echo "\n";
20 echo 'By adding \'merge <locale>\' to the command line arguments, you\'ll merge', "\n";
21- echo 'the locale\'s messages.PO file with the messages.POT file. This is useful', "\n";
22- echo 'after having updated the messages.POT file, obviously.', "\n";
23+ echo 'the locale\'s messages.po file with the messages.pot file. This is useful', "\n";
24+ echo 'after having updated the messages.pot file, obviously.', "\n";
25 echo "\n";
26 echo 'By adding \'convert <locale>\' to the command line arguments, you\'ll convert', "\n";
27- echo 'the locale\'s messages.PO file to _global.php, which ', $app_name, ' uses.', "\n";
28+ echo 'the locale\'s messages.po file to _global.php, which ', $app_name, ' uses.', "\n";
29 echo "\n";
30 echo 'E.g.:', "\n";
31 echo ' php ', $my_basename, ' CORE', "\n";
32@@ -91,7 +91,7 @@
33 exit( 2 );
34 }
35
36-require_once $_app_root.'/conf/_config.php';
37+require_once $_app_root.'/qp_config/_config.php';
38
39 echo '** gettext helper tool for ', $app_name, ' **', "\n\n";
40
41@@ -224,12 +224,12 @@
42 chdir( $dir_root );
43
44 /* Find *.php files, but exclude:
45- * - all directories below templates/
46- * - the plugins/ directory
47+ * - all directories below qp_templates/
48+ * - the qp_plugins/ directory
49 * - the build/ directory
50 */
51 $cmd = 'find . \\( ';
52- $cmd .= '-path \'./templates/*[!/]/*\' -o -path \'./plugins/*\' -o -path \'./build/*\'';
53+ $cmd .= '-path \'./qp_templates/*[!/]/*\' -o -path \'./qp_plugins/*\' -o -path \'./build/*\'';
54 $cmd .= ' \\) -prune -o \\( -iname \'*.php\' -print0 \\) | xargs -0 ';
55 }
56 $cmd .= 'xgettext -o '.escapeshellarg($file_pot).' --from-code=iso-8859-15 --no-wrap --add-comments=TRANS --copyright-holder="The Quam Plures developers" --msgid-bugs-address=http://quamplures.net/ --keyword=T_ --keyword=NT_ --keyword=TS_ -F';
57@@ -333,7 +333,7 @@
58
59 if( $action == 'convert' )
60 { // convert messages.PO files to _global.php
61- require_once $_app_root.'/inc/locales/_pofile.class.php';
62+ require_once $_app_root.'/qp_inc/locales/_pofile.class.php';
63
64 foreach( $_locales as $l_locale )
65 {
66
67=== modified file 'tutorials/templates/examples/Item__is_featured.sample.php'
68--- tutorials/templates/examples/Item__is_featured.sample.php 2010-07-23 17:57:52 +0000
69+++ tutorials/templates/examples/Item__is_featured.sample.php 2010-08-07 12:14:42 +0000
70@@ -4,7 +4,7 @@
71 echo 'do featured item stuff here';
72 }
73
74-...
75+// ...
76
77 if( ! $Item->is_featured() )
78 {
79
80=== modified file 'tutorials/templates/examples/Item__is_intro.sample.php'
81--- tutorials/templates/examples/Item__is_intro.sample.php 2010-07-23 17:57:52 +0000
82+++ tutorials/templates/examples/Item__is_intro.sample.php 2010-08-07 12:14:42 +0000
83@@ -4,7 +4,7 @@
84 echo 'do intro item stuff here';
85 }
86
87-...
88+// ...
89
90 if( ! $Item->is_intro() )
91 {

Subscribers

People subscribed via source and target branches

to all changes: