Giter Site home page Giter Site logo

Conformance with CVarArg about l10n-swift HOT 3 CLOSED

decybel07 avatar decybel07 commented on July 17, 2024
Conformance with CVarArg

from l10n-swift.

Comments (3)

Decybel07 avatar Decybel07 commented on July 17, 2024 1
// First take the value of the translation for the key
let value = L10n.shared.string(for: "yourKey")

// Then use this value as a format to fill it with arguments
let filledValue = L10n.shared.string(format: value, args: ["KosratDAhmad"])

I'm going to add this functionality to String extension in this weekend.

from l10n-swift.

Decybel07 avatar Decybel07 commented on July 17, 2024

Thanks for your feedback

If you want to pass arguments to l10n function, you can do it in two ways:

  • array: "view_edit_profile_photos_content_text".l10n(args: [10])
  • variadic parameter: "view_edit_profile_photos_content_text".l10n(10)

version 5.0+

  • "view_edit_profile_photos_content_text".l10n(arg: 10)

from l10n-swift.

kosratdev avatar kosratdev commented on July 17, 2024

Hi there

How can I use args for strings, for example, I have the following example:

Hell, %@ welcome back.

How this feature will be done with this library??

from l10n-swift.

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.