usbong / UsbongKit

A framework for reading and displaying contents of Usbong Trees
www.usbong.ph
Apache License 2.0
2 stars 1 forks source link

Question text of radioButtonsWithAnswer does not get translated #11

Closed masarapmabuhay closed 7 years ago

masarapmabuhay commented 7 years ago

Salut! I found that the question text (not the options) of the radioButtonsWithAnswer node does not get translated even if there is a translation available in the trans folder.

screen shot 2016-10-27 at 8 56 49 am
    <task-node name="radioButtonsWithAnswer~@audioName=question1~1. What is いちじはん (ichijihan)?Answer=1">
        <task name="A) 11:00"></task>
        <task name="B) 1:30"></task>
        <task name="C) 3:00"></task>
        <task name="C) 4:30"></task>
        <transition to="imageTextDisplay~correct~@audioName=correct~1~Correct!{br}The correct answer is: B) 1:30" name="Yes"></transition>
        <transition to="imageTextDisplay~incorrect~@audioName=incorrect~1~Incorrect!{br}The correct answer is: B) 1:30" name="No"></transition> 
    </task-node>

Merci beaucoup!

masarapmabuhay commented 7 years ago

Bonnes nouvelles! Good news! I was able to fix this issue! I added translateText(parseText(...))in // Rejoin.

screen shot 2016-10-27 at 9 21 38 am
                case .RadioButtonsWithAnswer:
                    let separator = "Answer="
                    var components = finalText.componentsSeparatedByString(separator)

                    // Get answer
                    if components.count > 1 {
                        currentTargetSelectedIndex = Int(components.removeLast())
                    }

                    // Rejoin
                    let text: String = translateText(parseText(components.joinWithSeparator(separator)))

                    // Create RadioButtons
                    node = RadioButtonsNode(text: text, options: tasks)

May I ask how I can send a pull request to merge our code via Xcode? I use SourceTree for UsbongKit (Android).

Merci bien!

chrisamanse commented 7 years ago

https://github.com/usbong/UsbongKit/issues/12#issuecomment-256529663

masarapmabuhay commented 7 years ago

Salut! I have merged the fix to UsbongKit (iOS)-master! I used SourceTree. Merci bien!