Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for comments #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

hu55a1n1
Copy link

No description provided.

@marmelroy
Copy link
Owner

Thanks @Sufi-Al-Hussaini. I like this syntax a lot!

We will need to add this to the Swift genstrings script too (the python string will be eventually deprecated).

@hu55a1n1
Copy link
Author

You're welcome @marmelroy . And thank you for this cool library.
I'm sorry I missed the swift script. I will look into it.

Meanwhile, I was wondering if it would be better to have a chained comment() extension to String.
That way we could support comments on localizedFormat() as well, like:

textLabel.text = "Hello World".localized().comment("some comment")

@piv199
Copy link

piv199 commented Jun 30, 2016

It would be great to add comments to all localized strings

Could you also provide an opportunity to parse args that are passed to localizedFormat function and add them to comment, or something like this?

@nekrich
Copy link
Contributor

nekrich commented Oct 9, 2016

My 2¢
If convert localized() func to calculated property localized, then it would be nice to see func localized(with comment: String) -> String, that would be perfect to #53 .
It would be nice to write smth like this: string.localized(with: "Comment", using: "TableName", in: bundle).

@eimantas
Copy link

eimantas commented Apr 12, 2017

@nekrich - I'd go with "some string".localized("comment"). This way you'd have a syntax like this:

let localizedTitle = "Some title".localized("title for a view")
// read as: some title string is localized title for a view

The table name can be added as a second parameter with a from label:

let localizedTitle = "Some title".localized("title for a view", from: "some table")
// read as: some title is localized title for a view from some table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants