There aren't a lot of details about how it works — after all, they're
trying to sell their app localization service — but I can take an educated
guess. (Until I download their SDK and decompile it, that is.)

I think they use AspectJ to switch out `R` (either to a different mechanism
at compile time, or with a classloader trick and some activity redisplay
hooks; need to read the code), so they get to run their own code for string
loading. This also needs some hooks for inflation etc, so it might be more
than just R.string.

This seems to me like a lot of we do for our runtime locale switching in
Fennec, but bundled and necessarily using injection to make it easier to
integrate with third-party apps.

The switching out of callers of R.string to enable runtime download of
locale packs, stored on the SD card, is basically what I have sketched out
for Bug 945123.

On Sat, Dec 20, 2014 at 11:44 AM, Nicholas Alexander <[email protected]
> wrote:
>
> Hey folks,
>
> Whilst browsing IntelliJ plugins, I found the following fascinating
> approach to dynamic localization on Android phones:
>
> https://github.com/Transround/NativerSDK
>
> I've only skimmed it, so I don't understand how it does its work, but it's
> an idea that various folks, notably rnewman, have expressed interested in
> at times.  If you have a spare hour and an interest in aspect-oriented
> programming, I'd love a reply explaining how the SDK works.
>
> Yours,
> Nick
>
> _______________________________________________
> mobile-firefox-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/mobile-firefox-dev
>
>
_______________________________________________
mobile-firefox-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/mobile-firefox-dev

Reply via email to