GithubHelp home page GithubHelp logo

Comments (3)

iafan avatar iafan commented on June 15, 2024

I'm in IRC (nickname: iafan) during most of the day (I'm in PDT /GMT-7/ time zone). Feel free to ping me whenever you see me online.

Serge is not a tool to convert between different file formats. iOS and Android apps are usually pretty different, so there's no 100% match in strings. For example, strings with placeholders would be different for iOS and Android, unless you use some custom cross-platform format for placeholders.

Though one can technically write a plugin that would do the conversion at the time you run serge localize, I'd suggest doing such format conversion outside the Serge localization workflow. It can be a script that takes one android XML file and generates one corresponding .strings file at the specified path. You can take Serge's Android XML parser code as a base for this script.

Once you have the .strings file generated from your XML files, you can localize them with Serge the way I showed before — Serge will reuse translations there just fine.

from serge.

buptfarmer avatar buptfarmer commented on June 15, 2024

We have little common day time. (I'm in GMT+8/ time zone)
I found that parse_android plugin parse into "key:item", but ios project use array this way : key[0], key[1], key[2] , how could ios key[0] format reuse the android translation with "key:item" format?

android xml code

    <string-array name="day_of_week">
        <item>"Mon"</item>
        <item>"Tue"</item>
        <item>"Wed"</item>
        <item>"Thu"</item>
        <item>"Fri"</item>
        <item>"Sat"</item>
        <item>"Sun"</item>
    </string-array>

ios strings code


/*  */
"day_of_week[0]" = "Mon";

/*  */
"day_of_week[1]" = "Tue";

/*  */
"day_of_week[2]" = "Wed";

/*  */
"day_of_week[3]" = "Thu";

/*  */
"day_of_week[4]" = "Fri";

/*  */
"day_of_week[5]" = "Sat";

/*  */
"day_of_week[6]" = "Sun";

image

from serge.

iafan avatar iafan commented on June 15, 2024

Mapping of Android<=>iOS keys is totally up to you (and your conversion script). Serge only uses keys as hints (comments that provide additional context to translators). Even if your keys differ, Serge will still reuse the translations.

from serge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.