globally translate 'back' text in iOS navigation controller





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















in iOS NavigationController when ever previous ViewController does not have a title / or current page title is tool large, the back button is labeled with "back".



How can I translate this 'back' for other locals.
I know that there is another option to use lastViewController.navigationItem?.backBarButtonItem?.title but it changes the back button completely. I just what to change the 'back' text whenever complete title does not fit in.










share|improve this question























  • Do you want to translate it to another language or change it to a different English word?

    – Johannes Fahrenkrug
    Jan 4 at 15:12











  • I want to translate it for other locals

    – hasan
    Jan 4 at 15:15











  • See answer below.

    – Johannes Fahrenkrug
    Jan 4 at 15:17




















0















in iOS NavigationController when ever previous ViewController does not have a title / or current page title is tool large, the back button is labeled with "back".



How can I translate this 'back' for other locals.
I know that there is another option to use lastViewController.navigationItem?.backBarButtonItem?.title but it changes the back button completely. I just what to change the 'back' text whenever complete title does not fit in.










share|improve this question























  • Do you want to translate it to another language or change it to a different English word?

    – Johannes Fahrenkrug
    Jan 4 at 15:12











  • I want to translate it for other locals

    – hasan
    Jan 4 at 15:15











  • See answer below.

    – Johannes Fahrenkrug
    Jan 4 at 15:17
















0












0








0








in iOS NavigationController when ever previous ViewController does not have a title / or current page title is tool large, the back button is labeled with "back".



How can I translate this 'back' for other locals.
I know that there is another option to use lastViewController.navigationItem?.backBarButtonItem?.title but it changes the back button completely. I just what to change the 'back' text whenever complete title does not fit in.










share|improve this question














in iOS NavigationController when ever previous ViewController does not have a title / or current page title is tool large, the back button is labeled with "back".



How can I translate this 'back' for other locals.
I know that there is another option to use lastViewController.navigationItem?.backBarButtonItem?.title but it changes the back button completely. I just what to change the 'back' text whenever complete title does not fit in.







ios swift






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 4 at 15:03









hasanhasan

5271130




5271130













  • Do you want to translate it to another language or change it to a different English word?

    – Johannes Fahrenkrug
    Jan 4 at 15:12











  • I want to translate it for other locals

    – hasan
    Jan 4 at 15:15











  • See answer below.

    – Johannes Fahrenkrug
    Jan 4 at 15:17





















  • Do you want to translate it to another language or change it to a different English word?

    – Johannes Fahrenkrug
    Jan 4 at 15:12











  • I want to translate it for other locals

    – hasan
    Jan 4 at 15:15











  • See answer below.

    – Johannes Fahrenkrug
    Jan 4 at 15:17



















Do you want to translate it to another language or change it to a different English word?

– Johannes Fahrenkrug
Jan 4 at 15:12





Do you want to translate it to another language or change it to a different English word?

– Johannes Fahrenkrug
Jan 4 at 15:12













I want to translate it for other locals

– hasan
Jan 4 at 15:15





I want to translate it for other locals

– hasan
Jan 4 at 15:15













See answer below.

– Johannes Fahrenkrug
Jan 4 at 15:17







See answer below.

– Johannes Fahrenkrug
Jan 4 at 15:17














2 Answers
2






active

oldest

votes


















0














Interesting. Usually you shouldn't present the app's UI in a language different from the device language. Using NSLocalizedString will give you the desired behavior for free for your own UI strings.



And "Back" will automatically be "Zurück" when the device's language is changed to German, for example.



When the user has set his/her iOS device to Spanish, your app should be in Spanish. When it's set to English, the app should be in English. You should not present your app in Spanish unless the user has set his/her device language to Spanish.






share|improve this answer
























  • Yes you're right but lots of languages are not supported by Apple to be chosen as device language like 'Persian'

    – hasan
    Jan 7 at 7:55











  • Ah, OK. You can set Persian as a Preferred Language: github.com/jfahrenkrug/xcode-languages/blob/master/… but it won't switch the whole iPhone UI to Persian. It will enable you to use NSLocalizedString though. But you're right: You might still have to manually deal with non-localized Apple UI strings.

    – Johannes Fahrenkrug
    Jan 8 at 13:23



















0














Create a function that looks for the title string size and changes the back button from a “Back” string (relative to local language) to a back arrow if the title string size exceeds a certain amount of characters. Or save yourself some time and just keep the back button as a back arrow all of the time. Everyone knows a “<“ means go back when presented in a navigation bar.






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54041456%2fglobally-translate-back-text-in-ios-navigation-controller%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Interesting. Usually you shouldn't present the app's UI in a language different from the device language. Using NSLocalizedString will give you the desired behavior for free for your own UI strings.



    And "Back" will automatically be "Zurück" when the device's language is changed to German, for example.



    When the user has set his/her iOS device to Spanish, your app should be in Spanish. When it's set to English, the app should be in English. You should not present your app in Spanish unless the user has set his/her device language to Spanish.






    share|improve this answer
























    • Yes you're right but lots of languages are not supported by Apple to be chosen as device language like 'Persian'

      – hasan
      Jan 7 at 7:55











    • Ah, OK. You can set Persian as a Preferred Language: github.com/jfahrenkrug/xcode-languages/blob/master/… but it won't switch the whole iPhone UI to Persian. It will enable you to use NSLocalizedString though. But you're right: You might still have to manually deal with non-localized Apple UI strings.

      – Johannes Fahrenkrug
      Jan 8 at 13:23
















    0














    Interesting. Usually you shouldn't present the app's UI in a language different from the device language. Using NSLocalizedString will give you the desired behavior for free for your own UI strings.



    And "Back" will automatically be "Zurück" when the device's language is changed to German, for example.



    When the user has set his/her iOS device to Spanish, your app should be in Spanish. When it's set to English, the app should be in English. You should not present your app in Spanish unless the user has set his/her device language to Spanish.






    share|improve this answer
























    • Yes you're right but lots of languages are not supported by Apple to be chosen as device language like 'Persian'

      – hasan
      Jan 7 at 7:55











    • Ah, OK. You can set Persian as a Preferred Language: github.com/jfahrenkrug/xcode-languages/blob/master/… but it won't switch the whole iPhone UI to Persian. It will enable you to use NSLocalizedString though. But you're right: You might still have to manually deal with non-localized Apple UI strings.

      – Johannes Fahrenkrug
      Jan 8 at 13:23














    0












    0








    0







    Interesting. Usually you shouldn't present the app's UI in a language different from the device language. Using NSLocalizedString will give you the desired behavior for free for your own UI strings.



    And "Back" will automatically be "Zurück" when the device's language is changed to German, for example.



    When the user has set his/her iOS device to Spanish, your app should be in Spanish. When it's set to English, the app should be in English. You should not present your app in Spanish unless the user has set his/her device language to Spanish.






    share|improve this answer













    Interesting. Usually you shouldn't present the app's UI in a language different from the device language. Using NSLocalizedString will give you the desired behavior for free for your own UI strings.



    And "Back" will automatically be "Zurück" when the device's language is changed to German, for example.



    When the user has set his/her iOS device to Spanish, your app should be in Spanish. When it's set to English, the app should be in English. You should not present your app in Spanish unless the user has set his/her device language to Spanish.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 4 at 15:19









    Johannes FahrenkrugJohannes Fahrenkrug

    31.9k15101143




    31.9k15101143













    • Yes you're right but lots of languages are not supported by Apple to be chosen as device language like 'Persian'

      – hasan
      Jan 7 at 7:55











    • Ah, OK. You can set Persian as a Preferred Language: github.com/jfahrenkrug/xcode-languages/blob/master/… but it won't switch the whole iPhone UI to Persian. It will enable you to use NSLocalizedString though. But you're right: You might still have to manually deal with non-localized Apple UI strings.

      – Johannes Fahrenkrug
      Jan 8 at 13:23



















    • Yes you're right but lots of languages are not supported by Apple to be chosen as device language like 'Persian'

      – hasan
      Jan 7 at 7:55











    • Ah, OK. You can set Persian as a Preferred Language: github.com/jfahrenkrug/xcode-languages/blob/master/… but it won't switch the whole iPhone UI to Persian. It will enable you to use NSLocalizedString though. But you're right: You might still have to manually deal with non-localized Apple UI strings.

      – Johannes Fahrenkrug
      Jan 8 at 13:23

















    Yes you're right but lots of languages are not supported by Apple to be chosen as device language like 'Persian'

    – hasan
    Jan 7 at 7:55





    Yes you're right but lots of languages are not supported by Apple to be chosen as device language like 'Persian'

    – hasan
    Jan 7 at 7:55













    Ah, OK. You can set Persian as a Preferred Language: github.com/jfahrenkrug/xcode-languages/blob/master/… but it won't switch the whole iPhone UI to Persian. It will enable you to use NSLocalizedString though. But you're right: You might still have to manually deal with non-localized Apple UI strings.

    – Johannes Fahrenkrug
    Jan 8 at 13:23





    Ah, OK. You can set Persian as a Preferred Language: github.com/jfahrenkrug/xcode-languages/blob/master/… but it won't switch the whole iPhone UI to Persian. It will enable you to use NSLocalizedString though. But you're right: You might still have to manually deal with non-localized Apple UI strings.

    – Johannes Fahrenkrug
    Jan 8 at 13:23













    0














    Create a function that looks for the title string size and changes the back button from a “Back” string (relative to local language) to a back arrow if the title string size exceeds a certain amount of characters. Or save yourself some time and just keep the back button as a back arrow all of the time. Everyone knows a “<“ means go back when presented in a navigation bar.






    share|improve this answer




























      0














      Create a function that looks for the title string size and changes the back button from a “Back” string (relative to local language) to a back arrow if the title string size exceeds a certain amount of characters. Or save yourself some time and just keep the back button as a back arrow all of the time. Everyone knows a “<“ means go back when presented in a navigation bar.






      share|improve this answer


























        0












        0








        0







        Create a function that looks for the title string size and changes the back button from a “Back” string (relative to local language) to a back arrow if the title string size exceeds a certain amount of characters. Or save yourself some time and just keep the back button as a back arrow all of the time. Everyone knows a “<“ means go back when presented in a navigation bar.






        share|improve this answer













        Create a function that looks for the title string size and changes the back button from a “Back” string (relative to local language) to a back arrow if the title string size exceeds a certain amount of characters. Or save yourself some time and just keep the back button as a back arrow all of the time. Everyone knows a “<“ means go back when presented in a navigation bar.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 4 at 15:32







        user9470831





































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54041456%2fglobally-translate-back-text-in-ios-navigation-controller%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Monofisismo

            Angular Downloading a file using contenturl with Basic Authentication

            Olmecas