Set Language translation (String localisation) in Swift

Save

Set Language

Sometimes we need to make application for various language due to that reason we need to write string file in key value pair.

for this, we need to follow some steps.

1: create new string file name: Localizable.strings file.

2: select project from a project and set localization language like English, Arabic. (Actually, when you set language in swift it will create directory for each language like English: en.lproj file for each)

3: Now you create the global class that will access from any class.

4: write this function.

5: Now, time to access the file, here I have set for one language you can create for multiple languages by setting their code in (languageCode).

6: Write this function from any class

Here is code snippet:

. . .

Leave a Comment

Your email address will not be published. Required fields are marked*


Be the first to comment.

css.php

Webkul is a truly trusted and supported IT Company to develop business ideas for e-commerce. They provide professional support after deploying the solution to production and be responsible to act for fixing the reported issues or system errors. We highly encourage to deal with Webkul for business development.

Hussein Zawia

Hussein Zawia

Co-founder, 24Dokan

Talk to Sales

Global

Live Chat
Start a Project


    Message Sent!

    If you have more details or questions, you can reply to the received confirmation email.

    Back to Home