[Q] - Add Dutch language

Discussion in 'Question & Answers' started by Girly_88, Apr 20, 2012.

  1. Girly_88

    Girly_88Members

    Apr 20, 2012
    7
    0
    11
    Male
    Netherlands
    Dear users,

    I've succesfully decompiled FileExplorer.apk copied the folder "values-en" and renamed it "values-nl" and edited the xml files. Then I re-compiled it and Signed it. Then I pushed it back to the ROM (overwrote the old FileExplorer.apk).

    But, under Settings => Full Settings => Language & Input => Language there is no Dutch or Netherlands,

    now I was wondering, what did I miss?

    Kind regards :)

    Btw; The Miui.nl is somewhat dead.. so I want to translate it myself..!
     
  2. iBotPeaches

    iBotPeachesScript Gatekeeper

    Oct 31, 2011
    3,811
    1,115
    335
    Kansas
    Just because you did one APK, doesn't mean it will pop up in the settings. I believe you must do

    framework-res, framework-miui-res, and settings for that setting. Also, don't overwrite.

    Copy and have both values-en and values-nl
     
  3. MarkHUK

    MarkHUKFounder & Sys Op
    Staff Member

    just frames :) but the locale must cascade to all apks e.g. values-nl for every other apk for the locale to be picked up by the framework global locale
     
  4. Girly_88

    Girly_88Members

    Apr 20, 2012
    7
    0
    11
    Male
    Netherlands
    Thanks guys! At the moment I'm looking for an easy way to add the Dutch language, trying to automate it a little bit :) And I guess, that once I've added it, I don't have to translate everything, every week again :)
    And I'm writing an app that fixes the framework-miui-res.apk broken xml files.. Quite annoying :(

    EDIT: I've build an App to "translate" it quite easy.. however, I've encountered this:
    <string name="app_name">An App Name</string>
    <string name="something">There is some
    text here</string>
    <string name="title">Title</string>

    Now as you can see, the string with the name "something" is not on the same line, does this matter? Because my App fails to do this correctly.. it can only handle when the string is on one line (like this:)

    <string name="app_name">An App Name</string>
    <string name="something">There is some text here</string>
    <string name="title">Title</string>
     
  5. iBotPeaches

    iBotPeachesScript Gatekeeper

    Oct 31, 2011
    3,811
    1,115
    335
    Kansas
    Build your app to include new lines?

    If your using regex you can check for carriage return and new line feeds. ( \r \n)
     
  6. Girly_88

    Girly_88Members

    Apr 20, 2012
    7
    0
    11
    Male
    Netherlands
    Sorry, I should have been clearer.

    To translate miui from English to Dutch I use the translated xml files from the Dutch GB miui. To make it easier, I made an app / program that replaces the English sentences with the Dutch sentences (if the sentence is available), but since I read the file line by line, sometimes I get half sentences.

    Like in the strings.xml from antispam apk, on about 2/3 of the file there are two lines split. So I was wondering, does it matter if I put it back to one line instead of two?

    Thanks in advance :)
     
  7. iBotPeaches

    iBotPeachesScript Gatekeeper

    Oct 31, 2011
    3,811
    1,115
    335
    Kansas
    ooo.

    Don't read line by line. Use an XML reader to read xml nodes, which will include multi lines.
     
  8. Girly_88

    Girly_88Members

    Apr 20, 2012
    7
    0
    11
    Male
    Netherlands
    I've also tried it that way, using an XML reader, but look here, please:
    Original strings.xml XML source from the AntiSpam.apk (link):
    Code:
      <?xml version="1.0" encoding="utf-8"?>
      <resources>
      <string name="fw_blacklist_hint">"Berichten en oproepen van de zwarte lijst
      worden geblokkeerd"</string>
      <string name="fw_whitelist_hint">"Berichten en oproepen van witte lijst
      worden niet geblokkeerd"</string>
      </resources>
    
    Now you can see, that the sentence fw_blacklist_hint and fw_whitelist_hint is split in two lines.

    And this is the same code, but when read by an XML reader (link) :


    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <resources>
    <string name="fw_blacklist_hint">"Berichten en oproepen van de zwarte lijst worden geblokkeerd"</string>
    <string name="fw_whitelist_hint">"Berichten en oproepen van witte lijst worden niet geblokkeerd"</string>
    </resources>
    I hope you understand what I mean :p
    And thanks in advance :)
     
  9. MarkHUK

    MarkHUKFounder & Sys Op
    Staff Member

    it wont matter if they go onto a new line but its always good to try and tidy them up if you are editing :)
     
  10. Girly_88

    Girly_88Members

    Apr 20, 2012
    7
    0
    11
    Male
    Netherlands
    Ah, Oké! I thought, maybe it's split because of the formatting. Now, I can continue to finish the program :)
     
  11. MarkHUK

    MarkHUKFounder & Sys Op
    Staff Member

    apktool causes the issue, i've cleaned MOST of my XML up. If you are using my base for any work please be sure to credit it properly.

    Thanks,
    Mark
     
  12. Girly_88

    Girly_88Members

    Apr 20, 2012
    7
    0
    11
    Male
    Netherlands
    APKtool is also messing up the framework-miui-res XML files, right? Currently I use your (English) decompiled MIUI, do you have the XML somewhere around here?

    And credits, of course, without the English MIUI I wouldn't be able to translte it properly :)
     
  13. MarkHUK

    MarkHUKFounder & Sys Op
    Staff Member

    its all on github at http://github.com/miuiandroid

    Thanks,
    Mark
     
  14. Girly_88

    Girly_88Members

    Apr 20, 2012
    7
    0
    11
    Male
    Netherlands
    Mark, thank you!

    I appreciate your quick replies :)
    I'll post the result in the Dutch topic, and if you're interested in the "framework-miui-res XML fixer", just let me know :)

    Kind regards,
    Kevin :)
     
  15. MarkHUK

    MarkHUKFounder & Sys Op
    Staff Member

    Dont need a framework "fixer" my XML compiles fine from GitHub... thanks though :) and no problems regards to replies :)
     
  16. Satom

    SatomMembers

    Apr 23, 2012
    17
    2
    13
    Male
    Netherlands
    Ok! You use the same XML for every build, except if there are changes?
    (BTW; New account)
     
  17. MarkHUK

    MarkHUKFounder & Sys Op
    Staff Member

    correct.
     

Share Our Site