a1studmuffin / Cataclysm-DDA-Android

An unofficial Android port of Cataclysm: Dark Days Ahead.
https://play.google.com/store/apps/details?id=com.MichaelDavies.CataclysmDDA
Other
60 stars 12 forks source link

Internationalize Android option names and descriptions #15

Closed BrettDong closed 7 years ago

BrettDong commented 7 years ago

When we do internationalization of the game, we invoke xgettext program who scans the source tree for occurrences of _( "string" ) to generate a list of all in-game UI strings for translation. Next those strings will be translated by translators.

You added some options for the Android port, such as 'Skip welcome screen', 'Quicksave on app lose focus', 'Vibration duration', etc. A lot of players are playing the awesome Android port of the game but they don't know English, and I believe that those strings are necessary to be translated. With #ifdef __android__ macro guard, it creates no influence on desktop builds but strings inside will be detected by xgettext program.

#ifdef __ANDROID__
    add("ANDROID_SKIP_SPLASH", "android", _("Skip welcome screen"),
        _("If true, skips the Android welcome screen on app load."),
        false
        );

    add("ANDROID_QUICKSAVE", "android", _("Quicksave on app lose focus"),
        _("If true, quicksave whenever the app loses focus (screen locked, app moved into background etc.) WARNING: Experimental. This may result in corrupt save games."),
        false
        );

    mOptionsSort["android"]++;

I juts made a glimpse in this repo. Is my idea feasible?

a1studmuffin commented 7 years ago

Ah nice, yeah I wondered about this but I wasn't sure how my Android port would fit in with the original team's localization efforts.

If the CDDA team are willing to take the Android-specific strings within the main CDDA repo (thus allowing them to be translated, mostly just extra strings in options.cpp), I think it definitely makes sense to do this.

Perhaps it would make sense to wait until the Android version is out of beta first, as I imagine we'll be chopping and changing around the options for a little while.

BrettDong commented 7 years ago

Thanks for the quick reply.

If the CDDA team are willing to take the Android-specific strings within the main CDDA repo (thus allowing them to be translated, mostly just extra strings in options.cpp), I think it definitely makes sense to do this.

I'll listen for the attitudes of the CDDA team. If the idea is agreed, I'll submit a PR to the mainline repo or you can do that either.

Perhaps it would make sense to wait until the Android version is out of beta first, as I imagine we'll be chopping and changing around the options for a little while.

No worries, strings in the mainline game are changing rapidly.

a1studmuffin commented 7 years ago

Awesome, thanks a bunch :) Yeah let me know what the team think, it would be great to have this stuff translated, but I'll understand if they don't want to integrate code from an unofficial Android port into the repo. Whatever's best for the developers + community is fine with me.

Dyrewulfe commented 7 years ago

About this, it might be good to have a tracking branch for the main project to sub-tree merge in and out of. It would streamline sending things like the options upstream, as well as updating to the latest experimental version.

Preserving history on both sides of that setup could prove challenging though.

a1studmuffin commented 7 years ago

Yep this would be a nice thing to add to make merging latest experimental easier in the future. I avoided it for the initial code submit as I was facing enough challenges migrating from Perforce to GitHub. Currently I'm just doing it manually using the ANDROID guards to track changes in the Android branch, which obviously isn't ideal. Not sure how easy it will be to migrate to a remote tracking branch, but I think it's worth looking into before I grab experimental next.

On 16 Apr. 2017 4:32 pm, "Graywolfe813" notifications@github.com wrote:

About this, it might be good to have a remote tracking branch for the main project to sub-tree merge in and out of. It would streamline sending things like options upstream, as well as updating to the latest experimental version.

Preserving history on both sides of that setup could prove challenging though.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/a1studmuffin/Cataclysm-DDA-Android/issues/15#issuecomment-294336419, or mute the thread https://github.com/notifications/unsubscribe-auth/AGAQSYU-djpjFahHdn9GnCipftatt5w1ks5rwbXigaJpZM4M9qCG .

Dyrewulfe commented 7 years ago

I've been looking into this over the past few days. I think the best way to tackle this will be to do a rebuild. I think I can pull this off, and the sooner done, the better.

The approach I'd take for this would involve creating a new repository based from CleverRaven/CataclysmDDA, integrating the android project structure into it, and then graft the history and rebase the commits from your repository into the source on a seperate "android" branch.

Then I can push it to github as a new repo and pass ownership back.

There are a few major advantages to this approach. First, the port repo becomes a slightly modified mirror image of the original repo, with common history. This means code can flow both ways with no major hassles. Second, this sets the stage for mainlining the port itself, if the upstream devs should choose to do so.

Let me know if you want me to take a shot at it.

a1studmuffin commented 7 years ago

Yeah I agree this would be a good thing to attempt if you have the time. If you want to go ahead, I'll hold off on any commits until you've had a crack at it.

Just to make sure we're on the same page, I assume the final project layout would look something like this:

a1studmuffin\Cataclysm-DDA-Android:

a1studmuffin\Cataclysm-DDA:

The only thing I'm not sure on is the best way to handle the symbolic links between the two repos. Obviously it could just be a local setup step (dependent on your platform), but I'm wondering if the 'right' way to do it is with GitHub's submodules... seems a little tricky though since the 5 folders don't map directly to the other repo layout... so maybe a clearly documented local setup step is the simplest?

Dyrewulfe commented 7 years ago

Actually, the approach I'm planning to attempt will result in a single active repo. An actual fork of the original repository will be used only for making PRs upstream.

Within the android port repo, the master branch will be a direct clone with common ancestry to the original cdda repo(although not directly forked from it.) Development will take place within the android branch, where the project wrapper and all android specific changes will reside. The only complication that will cause is minor: PRs for Android code need to made to the Android branch.

The trickery that will make this work with minimal complication is an old one... Symlinks. It's possible to symlink the necessary directories into the project wrapper from their original locations, minimizing the differences between the port and upstream repos. We'll be able to just pull master from the a1studmuffin/Cataclysm-DDA repo, and then merge in Android. Easiest way possible to update to latest upstream. And for things like passing the options file upstream, we commit it to master, push to the fork of upstream, and make a simple PR.

Sound good?

P.S.-I always have time. I actually started playing with methods to do this nearly a week ago.

a1studmuffin commented 7 years ago

Cool, that sounds great, less complicated overall. I guess we just provide instructions in the readme on how to set up the symlinks for different platforms.

On 18 Apr. 2017 4:22 pm, "Graywolfe813" notifications@github.com wrote:

Actually, the approach I'm planning to attempt will result in a single active repo. An actual fork of the original repository will be used only for making PRs upstream.

Within the android port repo, the master branch will be a direct clone with common ancestry to the original cdda repo(although not directly forked from it.) Development will take place within the android branch, where the project wrapper and all android specific changes will reside. The only complication that will cause is minor: PRs for Android code need to made to the Android branch.

The trickery that will make this work with minimal complication is an old one... Symlinks. It's possible to symlink the necessary directories into the project wrapper from their original locations, minimizing the differences between the port and upstream repos. We'll be able to just pull master from the a1studmuffin/Cataclysm-DDA repo, and then merge in Android. Easiest way possible to update to latest upstream. And for things like passing the options file upstream, we commit it to master, push to the fork of upstream, and make a simple PR.

Sound good?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/a1studmuffin/Cataclysm-DDA-Android/issues/15#issuecomment-294699147, or mute the thread https://github.com/notifications/unsubscribe-auth/AGAQSXCMttg1bSJiBCUAWXH7aHk0YMgXks5rxFadgaJpZM4M9qCG .

Dyrewulfe commented 7 years ago

Git is pretty good about recreating symlinks automatically. It only fails if: a: filesystem doesn't support symlinks. b: permissions aren't available. c: unidentified errors(least likely case)

A clone of the repo will "just work" in 99%+ of cases. My dev environment is a stress case. Android loves to make things hard(I had to change the filesystem on my device to enable symlinks.)

P.S.- Git has become pretty damn impressive.

a1studmuffin commented 7 years ago

Is that definitely the case under Windows? I just did a quick search for "git symlink windows" and support has been pretty patchy in the past, depending on the specific Git implementation + version you install under Windows, and whether 'core.symlinks' is enabled in the Git config (I just checked GitHub Desktop and it's set to false by default, which seems a little suspicious). One way to find out I guess! ;)

On 18 April 2017 at 18:50, Graywolfe813 notifications@github.com wrote:

Git is pretty good about recreating symlinks automatically. It only fails if: a: filesystem doesn't support symlinks. b: permissions aren't available. c: unidentified errors(least likely case)

A clone of the repo will "just work" in 99% of cases. My dev environment is a stress case. Android loves to make things hard(I had to change the filesystem on my device to enable symlinks.)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/a1studmuffin/Cataclysm-DDA-Android/issues/15#issuecomment-294734563, or mute the thread https://github.com/notifications/unsubscribe-auth/AGAQSRx_uc3Aa1CCjjYTJemvU_UW_bhyks5rxHlZgaJpZM4M9qCG .

Dyrewulfe commented 7 years ago

Well, if we run into an issue there, we can cook up a few scripts to set them up, and .gitignore the links. That might be a better solution, anyways.

Edit: Figures I'd forget about how obstinent Windows can be about things. Probably because I've done my best to forget about Windows entirely. I think core.symlinks is disabled by default because it requires admin rights. However, from what I'm reading, it only needs to be done once(as long as the symlinks aren't changed after that.)

BrettDong commented 7 years ago

I uploaded the strings in yesterday evening for translators, and they're being translated now. The next step is to update the Android port for localized texts.

a1studmuffin commented 7 years ago

Awesome, thanks! So the strings will be available in the mainline .po files? If so, when we update to experimental next it should hopefully work automatically. :)

On 28 Apr. 2017 9:26 pm, "Brett Dong" notifications@github.com wrote:

I uploaded the strings in yesterday evening for translators, and they're being translated now. The next step is to update the Android port for localized texts.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/a1studmuffin/Cataclysm-DDA-Android/issues/15#issuecomment-297974435, or mute the thread https://github.com/notifications/unsubscribe-auth/AGAQSWLPTz_0KskY95uHh4PAvJ8Z62xJks5r0cz9gaJpZM4M9qCG .

Dyrewulfe commented 7 years ago

I've got the repository tweaked to allow us to pull in all mainline commits. So, we'll be able to pull them in now.