![]() |
#196 | ||
but forgot what it's like
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
Quote:
Quote:
And we could distribute just a sources for locale definition: UTF-8 charmap and appropriate locale's input files. Then compile locale sources into a locale definition right at KT |
||
![]() |
![]() |
![]() |
#197 |
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
@eureka:
Here is the output for all locales. Spoiler:
This would mean that we put 46 MB of locale definitions in the repository (one-time, these files don't change). I have never compiled a locale, but if you say you needed to pull loads of dependencies, then I'm strongly in favor of bundling already compiled files instead of compiling them on the Kindle. The size is not a terribly big issue, except for the current way of providing localized daily snapshots via ge.tt. @JustAMan: The output looks fine, and I'm currently updating the Java stuff with it. One minor suggestion: could you make the output sorted? This is tremendously useful when scanning through it "manually". I'm currently using the little perl program shown below to sort it, but it'd be nice if you could include this in your tool. Code:
open IN, "blacklist-de.txt" or die $!; my %V; my ($k, $v); while (<IN>) { $_ =~ s/[\r\n]+$//; next if (/^\s*$/); if ($_ =~ /^\s*\/\//) { $k = $_; } else { $v = $_; } $V{$k} = $v; } close IN; foreach $k(sort keys %V) { print "$k\n"; print $V{$k}."\n"; } |
![]() |
![]() |
![]() |
#198 | |
Groupie
![]() ![]() Posts: 153
Karma: 113
Join Date: Jan 2012
Location: Russia
Device: Kindle Touch
|
I don't know Perl and I'm scared by its syntax
![]() So I may only guess what your script does. Am I right that it sorts lexicographically by "file path#property name=property value" string? Assuming I was right deducing what your script does I reworked my checkit.py output. Now it does: 1) sorting by folder name (e.g. com.amazon.*) 2) then by file name (e.g. BlogHomeWidget*) 3) then by property name I also tried making the output better human-readable. Give it a try, I've just pushed it to bitbucket. Quote:
|
|
![]() |
![]() |
![]() |
#199 | |
but forgot what it's like
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
Quote:
Spoiler:
9 MB. Only some of input files (with required UTF-8 charmap) should go into specific update bunldle with localization (specific locale input file and it's dependencies). And "dependencies" aren't abstract dependencies, it's just other input files from provided list. Dependency tree could be computed once by recursive searching of copy directive in input file. Last edited by eureka; 01-29-2012 at 12:49 PM. Reason: typo |
|
![]() |
![]() |
![]() |
#200 |
Groupie
![]() ![]() Posts: 153
Karma: 113
Join Date: Jan 2012
Location: Russia
Device: Kindle Touch
|
I don't get the issue... This 46 MB stuff is all locales, right? And a bundle should contain only one locale, that is approx. 300-400 KB in ixtab's list... So why don't just include it in the update.bin?
|
![]() |
![]() |
![]() |
#201 | |
but forgot what it's like
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
Quote:
But specific update bundle, of course, will include only needed locale definition picked from this 46MB stuff. |
|
![]() |
![]() |
![]() |
#202 |
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
@eureka: I probably didn't make this clear enough. The 46 MB is what would only be required on the computer which produces the (Kindle) locale bundles. The advantage of having everything there in this manner are
|
![]() |
![]() |
![]() |
#203 | ||
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Quote:
Nevertheless, because of the incredibly powerful regular expression support, it allows to very quickly write programs to transform text input from one format to another. In this case, I simply took the output from your tool, treated every line starting with "//" as a key, and every other line as a value, put the entire thing into a hashmap, and dumped the entire hashmap sorted by keys. "The only language that looks the same before and after RSA encryption is Perl." If you really want to be scared and blown away at the same time, look at http://perlgolf.sourceforge.net/ Anyway, your output is fine now (though I admit I liked the previous one with only one comment line better. The new one adds too much noise IMO). Just look at the big,big green chunk in the code that I just checked in, and you'll probably get what I mean. Quote:
![]() |
||
![]() |
![]() |
![]() |
#204 | |
but forgot what it's like
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
Quote:
Cons of source files solution: dependency tree should be computed (or pre-computed only once and then it will be stored in repo). Dependency tree is required but only for package-producing computer. Pros of source files solution: Git repo will be smaller in size (9 additional MBs against 46 additional MBs) |
|
![]() |
![]() |
![]() |
#205 |
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Looking at my last commit, I'm not so sure if keeping source code and translations in the same place is the best idea. I'm sure there is a way out using git branches, but it seems like I'm too stupid to actually use them correctly.
I admit I'm a total noob at git, and just don't get what effects "git checkout", "git branch" etc have, especially concerning how it relates to keeping local and remote versions synchronized over parallel branches. I repeatedly got errors while trying to commit on "master" which said something about fast-forward, and I figured I needed to "git checkout js-tool; git pull; git checkout master" to get it working again. While this worked, I still don't know WHY it worked. Can someone make this clearer, or is there a "git for idiots" page somewhere? |
![]() |
![]() |
![]() |
#206 |
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
@eureka: feel free to modify the sources for the "let the kindle compile things" approach, or at least to provide exact instructions for how it could be achieved.
Your suggestions are certainly very welcome and have been useful more than once. I'm also fine with putting (actually a lot of) effort into this. But I honestly don't want to figure out everything on my own again, if you already know how to do it. |
![]() |
![]() |
![]() |
#207 | |
but forgot what it's like
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
Quote:
![]() Honestly, I am understanding it no so much too ![]() |
|
![]() |
![]() |
![]() |
#208 | |
but forgot what it's like
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
Quote:
![]() ![]() |
|
![]() |
![]() |
![]() |
#209 |
(offline)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,907
Karma: 6736094
Join Date: Dec 2011
Device: K3, K4, K5, KPW, KPW2
|
Concerning the "translations on git" issue, I see 3 possibilities:
Option 1) would ensure that only code is in the git repository. Option 2) would only include "base" translations (en_US as extracted from the device). Option 3) would make sure that everything localized so far is in the repository. Regardless of which option is selected, a "tx pull -a -s" can restore all translation files (including the sources). - "tx pull -a -s" might interfere with git operation using options 2 and 3 ("git pull" refusing to overwrite untracked files). - "tx pull -s" might interfere with git operations using option 2 in (very) rare circumstances. - none of the transifex commands would interfere with git using option 1 (quite simply, because none of the files touched by transifex would be known to git). I have a slight preference for option 2), because
What do you guys think? Last edited by ixtab; 01-29-2012 at 02:38 PM. Reason: bugfix. |
![]() |
![]() |
![]() |
#210 |
but forgot what it's like
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
|
@ixtab, what is a problem? Interspersing of tool changes with translation changes in single commit?
UPD: ah, I see. But adding or changing of files (even untracked) shouldn't a problem for Git. Could you be a bit concrete in Git error messages? Anyway, I'm sticking with 3. git includes ALL translations. Resources (source and translations) are the main content of Git repo. Tools aren't. (no offence assumed, it's not about quality or unnecessity). Last edited by eureka; 01-29-2012 at 02:49 PM. Reason: ah, I see the problem |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Kindle 3 localization | JirkaS | Kindle Developer's Corner | 287 | 05-20-2018 10:08 AM |
[K3] Physical keyboard localization | Sir Alex | Kindle Developer's Corner | 112 | 05-19-2018 11:23 PM |
Kindle 4 (no touch) GUI Localization | Sir Alex | Kindle Developer's Corner | 43 | 09-13-2013 07:19 AM |
Keyboard localization (hack) | Sir Alex | Kindle Developer's Corner | 72 | 04-16-2013 03:05 PM |
Kindle 3, Nook Simple Touch, Kobo Touch and Libra Pro Touch | jbcohen | Which one should I buy? | 4 | 06-18-2011 07:58 PM |