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

_("string") in code #6078

Closed
Soyweiser opened this issue Feb 12, 2014 · 7 comments

Comments

Projects
None yet
4 participants
@Soyweiser
Copy link
Contributor

commented Feb 12, 2014

Question, why do we have _("string") in the code. I have no idea what that is supposed to do. And I would think "string" works just as well.

@BevapDin

This comment has been minimized.

Copy link
Contributor

commented Feb 12, 2014

This is for the translation. _ is actually a macro to some gettext function which returns the translated string (based on the current locale at runtime). Google gettext and i18n.

@Soyweiser

This comment has been minimized.

Copy link
Contributor Author

commented Feb 12, 2014

Thanks a lot. did I miss some documentation about this?

@Sheco

This comment has been minimized.

Copy link
Contributor

commented Feb 12, 2014

It is common knowledge when dealing with i18n

@Soyweiser

This comment has been minimized.

Copy link
Contributor Author

commented Feb 12, 2014

I had no idea.

@Sheco

This comment has been minimized.

Copy link
Contributor

commented Feb 12, 2014

Google gettext

@Soyweiser

This comment has been minimized.

Copy link
Contributor Author

commented Feb 12, 2014

I have :D

@Soyweiser Soyweiser closed this Feb 12, 2014

@Soyweiser Soyweiser reopened this Feb 12, 2014

@Soyweiser Soyweiser closed this Feb 12, 2014

@kevingranade

This comment has been minimized.

Copy link
Member

commented Feb 12, 2014

It's a macro that expands to the function "gettext()". This is a function
that both allows extracting strings into a table for translation, and if
running in localized mode does a string lookup and substitutes the
translated version.
Normally something sup

Question, why do we have _("string") in the code. I have no idea what that
is supposed to do. And I would think "string" works just as well.

Reply to this email directly or view it on GitHubhttps://github.com//issues/6078
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.