Commit graph

8042 commits

Author SHA1 Message Date
Eric House
9d23aef31d when a string has format specifiers, highlight them, and offer a
newbie tip explaining the translation must match.
2014-05-22 23:50:44 -07:00
Eric House
a6d8a74102 move a few methods, and add utilities, to superclass. 2014-05-22 23:35:51 -07:00
Eric House
4b26e04691 fix update when text cleared: passing null to setText() is ok 2014-05-22 06:46:59 -07:00
Eric House
91d7213be6 fix strings.xml files, syncing names and removing obsolete elements 2014-05-22 06:35:08 -07:00
Eric House
f87bf2f95d allow non-English strings.xml files to have duplicate text 2014-05-22 06:07:55 -07:00
Eric House
d1aa5d73f2 don't allow to save translation where format specifiers don't match; cleanup 2014-05-22 05:59:43 -07:00
Eric House
6f6781ceed move dialog creation stuff into activity base class 2014-05-21 22:03:56 -07:00
Eric House
174ee22a4b use inherited invalidateOptionsMenuIf() 2014-05-21 20:08:57 -07:00
Eric House
0b379a941b snapshot: add menu to xlation item editor. 2014-05-21 06:59:38 -07:00
Eric House
2293e6a730 remove unused imports 2014-05-21 06:56:51 -07:00
Eric House
3055a0a1e4 result of running fix_loc_xmls.py with new -% option 2014-05-20 20:54:12 -07:00
Eric House
9a9a4e2991 add option to replace %s with %1$d etc. 2014-05-20 20:53:48 -07:00
Eric House
0b6549d829 as formatted by python scripts, but without any non-whitespace changes 2014-05-20 20:52:18 -07:00
Eric House
dbaa28de5e don't refuse to delete local translation 2014-05-20 07:00:03 -07:00
Eric House
9bf92257b9 ignore more stuff 2014-05-19 07:54:08 -07:00
Eric House
af5cbe5325 need to call super when don't handle an id locally 2014-05-19 07:53:41 -07:00
Eric House
4452adf33d no blank Translate menu titles 2014-05-19 07:26:10 -07:00
Eric House
1ebf51d3ab when building from modified tree, still use latest commit number for
about box for easier debugging. Shouldn't matter for releases.
2014-05-19 07:15:21 -07:00
Eric House
f8dbc91cb0 don't set constant if R.java has uncommitted changes 2014-05-19 07:10:29 -07:00
Eric House
8f15f76fed label xlations with the language name 2014-05-17 16:57:24 -07:00
Eric House
018424e6e8 modify item text after the db backing it is modified by covering edit
activity.
2014-05-16 22:11:18 -07:00
Eric House
dfbb1bae71 derive context from menu that's triggered from it rather than trying
to set it from onResume() calls.
2014-05-16 22:05:48 -07:00
Eric House
3c4ed7de46 associate strings with the contexts in which they're looked up and
implement that filter.  I'm tracking by the name of the class rather
than a WeakReference, which means that the hashsets of keys will never
be freed.  Will need to see how much memory that means I'm using.
2014-05-16 06:40:01 -07:00
Eric House
c44a676808 derive from XWListActivity 2014-05-15 21:47:46 -07:00
Eric House
750393a5e6 oops: get the translation activity translated! 2014-05-15 06:53:03 -07:00
Eric House
891af6a84d use iter.remove to avoid ConcurrentModificationException 2014-05-15 06:43:59 -07:00
Eric House
6ce47f8208 use WeakReference rather than hashCode to associate menu with its strings 2014-05-15 06:37:03 -07:00
Eric House
5364f31da0 add filter and state-tracking for most recent menu. Used hashCode to
identify menu (since keeping a reference to it would cause it to
leak.) Will try WeakReference instead, or just dumping when another
comes along.
2014-05-15 05:41:15 -07:00
Eric House
e8efd70bdc tweak strings 2014-05-15 05:39:29 -07:00
Eric House
cbb10f6994 remove logging 2014-05-15 05:31:40 -07:00
Eric House
5e70d28ea1 first cut at filtering: all and modified work, but the other two
require that I track strings by the contexts in which they appear.
2014-05-14 21:24:29 -07:00
Eric House
6426e41d30 show locally-translated strings in red 2014-05-14 19:04:58 -07:00
Eric House
d00e49f843 save edited translations 2014-05-14 06:46:08 -07:00
Eric House
3040003126 oops -- include auto-modified files 2014-05-13 21:23:53 -07:00
Eric House
c4598f2bf9 tweak main translations strings layout 2014-05-13 21:22:50 -07:00
Eric House
4d42768f83 add separate activity/delegate for editing translations, launched by
tapping on a line in the list-o-strings.
2014-05-13 21:07:56 -07:00
Eric House
47eaca3d71 add filter spinner to translate dialog (though there's not yet data to filter on) 2014-05-13 06:30:38 -07:00
Eric House
049c55e2d2 toward adding default menu to all activities and eventually tracking
translations by where they're used so most relevant can be shown: put
back common superclasses XWActivity and XWListActivity with default
implemenations of activity lifecycle methods that call through to
delegates (and that later can help LocUtils track what's been seen
when.) Not thoroughly tested, but seems to work for the main screens
anyway.
2014-05-12 21:26:31 -07:00
Eric House
19204d5720 remove unused/commented-out file 2014-05-12 21:23:27 -07:00
Eric House
c42e5f2c0f keep elipses char where it belongs when reversing rest of strings 2014-05-11 20:15:10 -07:00
Eric House
49001c6893 various changes so dbg and bt versions build again -- and may work, but
that's not tested yet.
2014-05-11 19:55:05 -07:00
Eric House
2a3b8c7a74 when reversing words, preserve capitalization (i.e. start don't end with a cap) 2014-05-10 06:52:26 -07:00
Eric House
c06f0e157d first cut at file to clean up variant trees by removing anything not
under version control
2014-05-10 06:50:55 -07:00
Eric House
b085aeeb46 translate DialogPreference title, message and buttons 2014-05-06 21:13:10 -07:00
Eric House
30b966b902 generate fake translations automatically 2014-05-06 07:47:29 -07:00
Eric House
c0afd40337 update test section to work again 2014-05-06 07:25:00 -07:00
Eric House
806851057c update translations, late. This needs to be automated!! 2014-05-06 07:24:17 -07:00
Eric House
0ff09868cb Query user before removing build dir 2014-05-06 06:58:57 -07:00
Eric House
a4cd137cef get rid of #1 used to make strings unique: remove duplicates where
possible, and where not replace it with a non-printing zero-width
unicode char.
2014-05-06 06:27:33 -07:00
Eric House
d566bd63ae break the last Activities out into Delegates, and move a bunch of
stuff info the delegate base class so fewer calls required on
m_activity and LocUtils.
2014-05-06 05:56:43 -07:00
Eric House
5d9e846316 make constructor protected 2014-05-06 05:55:33 -07:00
Eric House
ce77f09588 the new spinner adapter override works much better for game config's
spinners
2014-05-05 07:38:37 -07:00
Eric House
96ca4f9946 fix NPE: not all spinners have adapters 2014-05-05 07:27:06 -07:00
Eric House
1170a31385 translate spinners by replacing their adapters with new class that
delegates to old then translates any views returned
2014-05-05 07:19:35 -07:00
Eric House
6165fc2201 translate list summary 2014-05-05 06:45:37 -07:00
Eric House
22a9fbdb3e translate color setting pref dialog 2014-05-05 06:37:05 -07:00
Eric House
3a7111c098 translate ListPreference lists 2014-05-05 06:03:33 -07:00
Eric House
477019757e make getopt flags match what usage says is there 2014-05-04 16:39:56 -07:00
Eric House
1fcf9027cb when looking for a translation for locale xx_YY, if there is none try
again for just xx. And silently drop strings in the translation file
with names that don't exist in English, though eventually that
shouldn't happen.  With this change a newly installed app on a
claiming-to-be-Czech emulator picks up the Czech translation within
moments.
2014-05-04 16:26:35 -07:00
Eric House
edcd29c88d in order that non-English versions not go long after installation
without translations, try immediately after any install or upgrade to
get translations from server.  (Triggered from the Application rather
than an Activity, so initializing the preferences DB had to be moved
there too.) Should probably post a notification after installing
localizations, ideally with a message in the language, offering to
restart with all new strings.
2014-05-04 15:41:02 -07:00
Eric House
6d60e45eb9 tweak fake translation generation (and include new strings) 2014-05-02 22:08:44 -07:00
Eric House
43f90cb3b0 use -1 as array index 2014-05-02 22:03:02 -07:00
Eric House
ad65b93ef2 changes necessary to actually return a translation based on revision
hash of R.java passed by client, or none if it already has it.  Rough,
but works.
2014-05-02 22:00:25 -07:00
Eric House
56a057f06c when translations get out of sync with R.java values, there's often a
format exception.  Catch that, and strip out the locale's translations
so the app at least doesn't crash.  This should not happen once I have
the server side right, but it'll help now and provide a safety net
later.
2014-05-01 22:05:57 -07:00
Eric House
8d6f46fa22 snapshot. Should work for current case where the newest R.java is older than the app connecting 2014-05-01 08:15:42 -07:00
Eric House
7b40abfa2f more features and some refactoring 2014-05-01 08:14:40 -07:00
Eric House
5a22e08664 no need for package name in app info as it's in the top-level obj 2014-04-30 07:28:42 -07:00
Eric House
164387b37d update to use mygit 2014-04-30 07:25:23 -07:00
Eric House
6d194e5362 don't chdir (which isn't cool when a cgi); use subprocess's cwd param instead 2014-04-30 07:08:59 -07:00
Eric House
d91c307792 include hash of current R.java in xlation update json, not of the entire app 2014-04-30 03:29:47 -07:00
Eric House
a3bcef18f0 add more functionality 2014-04-29 21:15:50 -07:00
Eric House
a7c4730eb5 start of a file to interact with git for getting xlations 2014-04-29 06:53:02 -07:00
Eric House
d463ea3f30 commented-out line to copy xwdb into /sdcard from which it can be retrieved 2014-04-29 06:43:11 -07:00
Eric House
4279457471 name change to remind what script is doing 2014-04-29 06:43:11 -07:00
Eric House
b4d5130588 Merge remote branch 'origin/android_localize' into android_localize 2014-04-29 06:39:35 -07:00
Eric House
7ea037d56a work with arrays of locales 2014-04-29 06:33:14 -07:00
Eric House
6c46ce2297 send and receive array of locales for translation info, one of which
is the device's current default.  Plan's to include a fake as well if
set, but currently that replaces the default.
2014-04-28 07:58:23 -07:00
Eric House
b42c372c79 send git version code, app package name, and git hash with all messages 2014-04-27 20:03:40 -07:00
Eric House
be817feb55 add git rev hash as constant (and usage()) 2014-04-27 20:03:08 -07:00
Eric House
19badff420 tweak text 2014-04-27 19:21:21 -07:00
Eric House
b87a7e808c don't fail building if scp fails 2014-04-27 19:08:04 -07:00
Eric House
33a83b0e2f toward use of data text messages for games: don't let CDMA phone users
turn data messages on, and when checking if SMS is supported say yes
for KitKat users if they've successfully turned data on.
2014-04-27 13:34:09 -07:00
Eric House
f386cd5c1b for consistency, createDialog -> onCreateDialog 2014-04-27 13:17:48 -07:00
Eric House
716109e979 Merge branch 'android_branch' into android_localize
Conflicts:
	xwords4/android/XWords4/src/org/eehouse/android/xw4/PrefsActivity.java
	xwords4/android/XWords4/src/org/eehouse/android/xw4/SMSService.java
2014-04-26 22:04:57 -07:00
Eric House
c82c59d985 experimental: enable SMS on KitKat if debug setting to use Data SMS is on 2014-04-26 20:04:55 -07:00
Eric House
fbb042ffee merge android_branch -> android_sms_kitkat 2014-04-26 18:31:05 -07:00
Eric House
ae4c6e98f2 replace escaped carraige returns and unicode from resources to get
closer to what getString returns.  If I can't find an Android API to
do this it should be done on the server, but this is an improvement
until I do.
2014-04-25 20:58:14 -07:00
Eric House
540eb73aec merge android_branch 2014-04-25 20:33:57 -07:00
Eric House
ead0fdf668 merge from_android_beta_82-> 2014-04-25 20:29:54 -07:00
Eric House
f954b09391 merge android_branch-> 2014-04-25 18:47:24 -07:00
Eric House
19573af533 a more elegant way of building up params to pass to PQexecParams 2014-04-25 18:45:51 -07:00
Eric House
a7c1724bb8 another change 2014-04-25 07:46:33 -07:00
Eric House
2f3a7f4bd2 allow board screen to be "upside down" on OS version new enough to
support it (and make SMS Invite Activity go any way, just like
everything else)

Conflicts:
	xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardActivity.java
2014-04-25 07:46:22 -07:00
Eric House
6eaf7a57b5 fix crash when there's a "'" in model name 2014-04-25 07:41:58 -07:00
Eric House
7818cd002b merge android_branch->android_localize 2014-04-24 20:00:38 -07:00
Eric House
6e011ab36f allow board screen to be "upside down" on OS version new enough to
support it (and make SMS Invite Activity go any way, just like
everything else)
2014-04-24 19:59:20 -07:00
Eric House
808e342cd4 clean up 2014-04-24 19:58:18 -07:00
Eric House
28e81e3a74 translate preferences -- finally. 2014-04-24 07:56:27 -07:00
Eric House
3b4c672492 toward substituting what getString (or the resource compiler) normally does. 2014-04-24 07:08:57 -07:00
Eric House
ed3370133f use lowercase \u instead; \U isn't acceptable in java 2014-04-24 07:01:53 -07:00
Eric House
00ecf0d9d0 be consistent using capital-U \U to indicate unicode 2014-04-24 06:53:13 -07:00
Eric House
28c0862604 translations come in with ids rather than English strings as keys 2014-04-24 06:31:27 -07:00
Eric House
8612a5f624 use IDs rather than english strings as keys in passing
translations. Requires parallel change on client, and currently
doesn't quite work because e.g. \n is not replaced before the
translation is rendered.
2014-04-24 06:24:38 -07:00
Eric House
1e5a474692 remove unneeded param 2014-04-24 06:21:10 -07:00
Eric House
7434c6a3a7 cleanup 2014-04-23 19:41:44 -07:00
Eric House
6d7d4955a0 more informative log message 2014-04-23 19:38:16 -07:00
Eric House
780b22678e add param caller expects 2014-04-23 19:35:35 -07:00
Eric House
36f839f8d1 more stuff to not reverse/capitalize (e.g. "\n"); print to stdout by default 2014-04-23 19:35:10 -07:00
Eric House
19c32b0444 Merge branch 'android_branch' into android_localize
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
2014-04-23 07:44:51 -07:00
Eric House
6a4c599da5 Merge remote branch 'origin/android_branch' into android_branch 2014-04-23 07:40:46 -07:00
Eric House
e25a0e7dbc changes for translation downloading 2014-04-23 07:39:36 -07:00
Eric House
cb96960446 let's track changes in the fake translations for a bit 2014-04-23 06:28:03 -07:00
Eric House
e643e9d5c0 add debug preference via which Translate menuitems must be enabled 2014-04-22 21:06:05 -07:00
Eric House
0a3371a82f break most of PrefsActivity into PrefsDelegate 2014-04-22 20:59:58 -07:00
Eric House
f410f8bb1a separate local and blessed (server) translations, fix to update or insert correctly and handle keys with embedded quotes, etc. Works to download translations, but a lot of longer keys don't seem to be matching. 2014-04-22 07:43:55 -07:00
Eric House
0e9790ee7c new string 2014-04-22 07:42:26 -07:00
Eric House
66768c7e7d better formatting and key identity checking 2014-04-22 07:30:32 -07:00
Eric House
ec0443b2ce add constraint to loc table 2014-04-22 07:29:35 -07:00
Eric House
94597ee287 record R.java where it won't be used. I want to see how often, and in what ways, it changes. 2014-04-21 19:46:27 -07:00
Eric House
45b1b0bfa8 script to produce the translation array that's downloaded to device 2014-04-21 07:13:41 -07:00
Eric House
0bf8b45157 implement reverse fake-locale 2014-04-20 21:36:41 -07:00
Eric House
5d3beb6404 script to generate fake locales from English strings.xml for use testing downloading translations 2014-04-20 21:26:43 -07:00
Eric House
155dd6f19a snapshot: now receives updates from the server and they show up in
menus etc. (after a restart.)
2014-04-20 06:49:26 -07:00
Eric House
f0bd300f1b add setter for new table 2014-04-20 06:45:00 -07:00
Eric House
ed7da84da6 fix compile: add missing param 2014-04-18 19:38:12 -07:00
Eric House
e0404801ba fix clean builds 2014-04-18 19:25:40 -07:00
Eric House
dbc42c3ad2 include xlation info in update request to server. It's not handled yet
and so the handling of the result is untested.
2014-04-18 08:03:01 -07:00
Eric House
901e07c0aa getter for new pairs DB 2014-04-18 08:02:25 -07:00
Eric House
b636fe263b new table for generic key/value pairs, and fix crash on new install by
not requiring localization db to exist during db creation.
2014-04-18 08:01:26 -07:00
Eric House
96c7f301d0 replace the last of the context.getString(...) calls with LocUtils.getString(context,...) 2014-04-18 07:14:27 -07:00
Eric House
ce59793458 use table to recover from too-new db. (tables are ugly in java) 2014-04-18 07:06:51 -07:00
Eric House
62ecd00971 remove redundant code 2014-04-18 06:26:25 -07:00
Eric House
4d08c7cef9 merge android_branch->android_localize 2014-04-18 06:21:45 -07:00
Eric House
33175e271c Merge remote-tracking branch 'sf/android_branch' into android_branch 2014-04-18 06:13:53 -07:00
Eric House
48eb900212 merge -> android_branch 2014-04-18 06:10:25 -07:00
Eric House
c576ec7d7d up client version so relay knows we're cool 2014-04-18 06:05:15 -07:00
Eric House
4de894627a fix infinite loop -- duh 2014-04-18 06:01:03 -07:00
Eric House
8ba19184a0 merge from_android_beta_82->android_branch 2014-04-17 08:32:39 -07:00
Eric House
529e6733d0 up strings for new release 2014-04-17 08:27:42 -07:00
Eric House
0e4f24dfe9 use fixed string for model rather than clearing it 2014-04-17 08:24:09 -07:00
Eric House
6f0b5c1bea empty the model string if the client version's lower than what I'm
about to release and there's non-ascii stuff in it.
2014-04-17 08:13:01 -07:00
Eric House
f05b1e0525 log model -- can remove later 2014-04-17 07:44:32 -07:00
Eric House
0897ae2ba9 log the bad query 2014-04-17 07:43:58 -07:00
Eric House
56ce5761d7 fix malformed utf-8: writeBytes just strips all but the last byte of multi-byte utf8 chars! 2014-04-17 07:42:34 -07:00
Eric House
843518af4d use antcall with params rather than dependency with global properties 2014-04-17 05:34:27 -07:00
Eric House
538cd7b154 disallow duplicate strings in strings.xml, manually appending #<digit>. Will eventually filter that out of displayed strings. 2014-04-16 21:14:53 -07:00
Eric House
f5f7428683 fix debug tree to build again, this time with a paramaterized common
xml file
2014-04-16 21:06:41 -07:00
Eric House
79dc66b3a7 add array index as comment 2014-04-16 07:44:10 -07:00
Eric House
be581e762e fix more getString calls -- just keeps going 2014-04-16 07:12:45 -07:00
Eric House
85ffd0cad9 fix getStrings() calls for studylists 2014-04-16 07:02:09 -07:00
Eric House
1eea5bfed5 route more getString() calls through LocUtils 2014-04-16 06:52:20 -07:00
Eric House
1c35bd2a1b call init from outside after constructor completes rather than from inside constructor 2014-04-16 06:46:24 -07:00
Eric House
e2ed445fca complete rename of activity 2014-04-16 06:44:38 -07:00
Eric House
57f9182a4d inval group cache after deleting a game 2014-04-16 06:44:24 -07:00
Eric House
6198992fcd rename file 2014-04-16 06:07:59 -07:00
Eric House
e5151c32be make constructor private 2014-04-15 21:22:56 -07:00
Eric House
9e78d23014 break up more activities into delegates, using all the new methods in
the base. Crashes a lot, but this is a snapshot to work from.
2014-04-15 21:02:40 -07:00
Eric House
2e89b95e70 add methods subclasses will be able to use 2014-04-15 20:31:29 -07:00
Eric House
d9a407c9f3 move to superclass 2014-04-15 08:07:04 -07:00
Eric House
3465605481 more moving stuff into superclass 2014-04-15 08:02:57 -07:00
Eric House
548ba63dda more use of overridden AlertBuilder and getString 2014-04-15 07:49:21 -07:00
Eric House
8432500541 override setPositiveButton and friends so ids can be translated 2014-04-15 07:40:27 -07:00
Eric House
e12fbcce8e more use of LocUtils.getString() 2014-04-15 07:34:14 -07:00
Eric House
01c94d91cd I apparently don't understand how varargs works in java 2014-04-15 07:31:57 -07:00
Eric House
3c76de6851 call method on superclass rather than activity 2014-04-15 06:38:51 -07:00
Eric House
dc8b5b073e use superclass's getString() where possible instead of LocUtils's static version 2014-04-15 06:36:18 -07:00
Eric House
9720684ce7 break activity up into delegate 2014-04-15 06:27:17 -07:00
Eric House
1cf7e70091 use superclass's setContentView() 2014-04-15 06:26:55 -07:00
Eric House
0ae63c37ac add convenience methods for subclasses 2014-04-15 06:26:37 -07:00
Eric House
f0b5584e38 translate activity window titles 2014-04-14 08:10:49 -07:00
Eric House
7f48783fb2 get translations working in dicts browser (save title) 2014-04-14 08:05:11 -07:00
Eric House
67ca205774 remove compile command -- which never worked 2014-04-14 08:04:44 -07:00
Eric House
d3c5aeb977 add param 2014-04-14 07:40:35 -07:00
Eric House
a0fd457ad1 add stuff, including ability to list strings missing in english or translated version 2014-04-14 07:40:24 -07:00
Eric House
a04f091d7f more cleanup: copy over comments and manually fix what script couldn't 2014-04-14 07:38:48 -07:00
Eric House
9a4474ac1e ignore .pyc file 2014-04-14 06:28:48 -07:00
Eric House
1249fa5849 call getString on LocUtils instead of context 2014-04-14 06:28:29 -07:00
Eric House
13e900695e call new AlertBuilder only once 2014-04-14 06:28:05 -07:00
Eric House
9abc7b3212 add comment 2014-04-14 06:24:09 -07:00
Eric House
5d5a828dc2 as new printer prints -- no changes but whitespace 2014-04-12 09:33:52 -07:00
Eric House
e227038354 move not-to-be-localized string out of string.xml 2014-04-12 09:22:45 -07:00
Eric House
42ba1baaf7 include preceeding comments with string text 2014-04-12 08:19:48 -07:00
Eric House
6b30248af0 one more _fmt add 2014-04-12 08:17:23 -07:00
Eric House
1b79bcb1c4 add and use ability to remove nodes 2014-04-12 06:37:55 -07:00
Eric House
fe287719eb more fixes 2014-04-12 06:32:50 -07:00
Eric House
b2c6aabd74 start updating: swap %1$[sd] for %[sd] 2014-04-12 06:20:37 -07:00
Eric House
64ebbcfbae mods to export getString 2014-04-12 06:16:32 -07:00
Eric House
539f1205c9 more script-generated changes 2014-04-11 23:34:15 -07:00
Eric House
5434a3c03c more changes by script 2014-04-11 23:17:25 -07:00
Eric House
ac4fc367bb first changes made by script 2014-04-11 23:12:16 -07:00
Eric House
30b861879a first modification made by script 2014-04-11 22:54:13 -07:00
Eric House
77b87c6458 localized files as read in and printed back out, unmodifed but for how
python prints them differently.  This is a baseline: modifications
will follow.
2014-04-11 22:43:56 -07:00
Eric House
258b81dfb5 add localized string files exactly as copied from android_branch 2014-04-11 22:19:25 -07:00
Eric House
a22763298a extend AlertDialog.Builder and override setTitle so string ids can be
translated when passed.
2014-04-10 21:34:08 -07:00
Eric House
10d6969930 fix release builds: generate empty version of checker function 2014-04-10 07:43:57 -07:00
Eric House
ff03284c5c for debugging (testing what strings aren't yet reachable), uppercase
all strings without a tranlation.
2014-04-10 07:31:56 -07:00
Eric House
5c5a353d12 add string array to spinner manually so it can be translated -- sucks
to have to change code for this, but...  The dropdown views look
crappy though I'm using identical code to what's in DictLangCache
building similar arrays that look fine.  Needs work.
2014-04-10 06:44:33 -07:00
Eric House
f3b5cbb794 fix NPE 2014-04-09 21:14:30 -07:00
Eric House
67bca0dd4e Because loc: strings can't be supplied for all Views, don't do
that. Instead use the English strings themselves as keys.  Generate a
java array of all R.string.whatever contants at build time, and use
that at runtime to build a hashmap of localizable strings that may be
found in UI widgets.  When one is found and there's a translation,
substitute.
2014-04-09 21:09:46 -07:00
Eric House
b4016eaec3 get rid of loc: stuff 2014-04-09 21:05:12 -07:00
Eric House
ce3fab3b15 don't try to write file if not specified 2014-04-09 07:29:56 -07:00
Eric House
7e72cb506d add some more logging/tracking. 2014-04-09 07:28:53 -07:00
Eric House
edf720c58c add EditText's hint. But Spinner's prompt MUST be a reference -- fuck you Android -- so I need another way to do this 2014-04-09 07:28:31 -07:00
Eric House
812c54f598 CheckBoxes get translated too 2014-04-09 07:10:55 -07:00
Eric House
291d4f0217 create table in new DB as well as when upgrading 2014-04-09 06:25:07 -07:00
Eric House
c96e848a05 remove unused method 2014-04-09 05:58:53 -07:00
Eric House
b61f1fbac9 fix crash adding first game to newly installed app by counting games and groups the same way getView determines if they exist. 2014-04-09 05:58:44 -07:00
Eric House
051cc5eb1d call init from outside constructor since constructor can call back into callee 2014-04-09 05:57:33 -07:00
Eric House
0aa2a03760 remove unused method 2014-04-09 05:54:36 -07:00
Eric House
5e03e0cc75 fix crash adding first game to newly installed app by counting games and groups the same way getView determines if they exist. 2014-04-09 05:52:36 -07:00
Eric House
1035c94c3f call init from outside constructor since constructor can call back into callee 2014-04-09 05:38:46 -07:00
Eric House
ccf84135a0 fix NPE on fresh install 2014-04-09 05:08:49 -07:00
Eric House
5d83d2f318 translate GameConfig view -- though it really needs to be broken to have a Delegate.... 2014-04-08 19:12:00 -07:00
Eric House
0ac951c096 remove format() in favor of LocUtils call 2014-04-08 19:00:49 -07:00
Eric House
0b93e77018 combine the xml-manipulation and java-class-generation scripts 2014-04-08 18:57:31 -07:00
Eric House
9e228ab368 use version of getString that translates 2014-04-08 06:54:16 -07:00
Eric House
d27f2d580a (more of prev commit) generate xml layout files from res_src, and run all inflation through LocUtils that tries to substitute strings 2014-04-08 06:48:42 -07:00
Eric House
201e808b4a move layout files into res_src, and modify script to mark their localizable strings with loc:; run all layout inflation through new function that substitutes for loc: 2014-04-08 06:47:33 -07:00
Eric House
848f6ff221 no longer need these custom classes 2014-04-08 06:44:41 -07:00
Eric House
dfb3ea842b get rid of the Loc* classes -- will be transforming xml at buildtime as with menus 2014-04-08 05:20:22 -07:00
Eric House
aad4872f68 generate menu resources from the old files, adding the 'loc:' key for those title strings listed in strings.xml 2014-04-07 08:14:09 -07:00
Eric House
96194671e2 move menu xml files outside build tree: scripts will generate now 2014-04-07 08:00:18 -07:00
Eric House
1bed9e3bec move menu xml files outside build tree: scripts will generate now 2014-04-07 07:59:55 -07:00
Eric House
4ce7f923c1 revert changes adding loc: to mark localizable strings: will be doing that automatically 2014-04-07 07:54:59 -07:00
Eric House
36672395ff store new column, always false for now 2014-04-07 07:47:08 -07:00
Eric House
227a25e259 add column for tracking xlation source 2014-04-07 07:09:43 -07:00
Eric House
437e2024cc generate hashmap from strings.xml -- all of them -- making it
unmodifiable, and test for stuff not being in it.
2014-04-06 18:58:33 -07:00
Eric House
86cc8f6dbf move onCreateOptionsMenu into superclass 2014-04-06 16:48:17 -07:00
Eric House
2ae6ecb125 get rid of allcaps translation, instead using translations where
available. Works -- but app needs to be restarted for menus to change.
2014-04-06 16:08:45 -07:00
Eric House
a351b2a5b9 implement search through loc dialog 2014-04-06 06:43:48 -07:00
Eric House
7e16d7abc5 add getContentView -- since I can never remember how to do it 2014-04-06 06:37:51 -07:00
Eric House
6b59093d84 use new loc db to save translation data (per locale) across boots. 2014-04-05 14:04:02 -07:00
Eric House
47ea2b8b62 add loc table to store translation data, mapping key and locale to text 2014-04-05 14:00:41 -07:00
Eric House
527685da79 preserve translation changes in memory. Next: write to DB. 2014-04-05 13:33:12 -07:00
Eric House
7dfa042b77 rename style and use it to align table header with columns 2014-04-05 12:12:00 -07:00
Eric House
663f4293a9 display English text on left side of table 2014-04-05 11:45:20 -07:00
Eric House
2494f7b8d4 add activity for localizing strings and add menuitem to localizable activities to trigger it. Does nothing yet, including populating itself. 2014-04-05 10:27:05 -07:00
Eric House
16346beeb1 enforce new convention: strings containing formatting must be names whatever_fmt (and strings containing formatting must be so named.) I'm going to have to parse such strings, which will be expensive, so being able to determine from the name whether there's a need should help. 2014-04-04 23:42:57 -07:00
Eric House
2b2fd32951 replace %s and %d (and enforce) 2014-04-04 23:09:50 -07:00
Eric House
409940adae remove localized files. They'll get used somehow but not in this form on this branch. 2014-04-04 23:09:22 -07:00
Eric House
073c461693 new type of problem: make a string array in ListPreference localizable 2014-04-04 08:00:30 -07:00
Eric House
589b740af6 include loc: strings from common_rsrc.xml 2014-04-04 07:59:16 -07:00
Eric House
2c9dc526c2 convert most of GamesList to be localizable 2014-04-04 06:50:08 -07:00
Eric House
9531c6939e add getString() variants to LocUtils and use from BoardActivity 2014-04-04 06:34:46 -07:00
Eric House
f6b2e5a3c2 transform submenus too 2014-04-04 06:20:46 -07:00
Eric House
0e7676b301 make board menu localizable -- but submenus don't work yet 2014-04-03 22:37:13 -07:00
Eric House
a6954a71dc menu title can be null 2014-04-03 22:36:47 -07:00
Eric House
11dabca721 generate mapping from actual strings to R.string.id that can be used at runtime to convert/lookup menu titles. Works to uppercase a menu! Changes break dbg and bt builds -- to be fixed. 2014-04-03 22:27:50 -07:00
Eric House
f2bfd36780 menus are broken: you don't get access to an AttributeSet when inflating them. So replace string references with strings equal to the name of the id (xxx in R.string.xxx); next I'll need to harvest the strings from R.java and map them to their numbers in a way that's runtime-accessible. 2014-04-03 06:21:02 -07:00
Eric House
2afe048095 fix formatting 2014-04-03 06:19:17 -07:00