-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Closes #147: provide reason why string templates shouldn’t be used #148
base: master
Are you sure you want to change the base?
Conversation
…be used Specifically, because they cannot be localised.
Is there a more specific subsection that could be linked to here? It's not immediately obvious that this page contains information to back this up |
@danrabbit Shall I remove the link? I’ve first-hand confirmed that template strings are not localisable (unless there is some configuration setting that’s not included in the developer guide for making them so) so the link is not necessary (I thought it would provide some interesting/related background). For non-localised strings, I don’t know of any reason why template strings should not be used. Perhaps we should mention that also. |
I'm not doubting you, I'm just wondering if there's a more specific section of this guide that mentions this. Otherwise yeah, it might not be worth linking here. It might be worth opening another branch with a little hint pullout in the localization section for this guide though I don't think we really necessarily need a reason other than this is the code style we use. A lot of things here—like cuddled else—are just convention |
Haha, didn’t think you were doubting me :) (Although, please do, I’m very new to these platforms.) Regarding stating the reason: I feel it’s important as you don’t want these things to become religious in nature (ditto for design decisions). Some conventions, of course, are just that. But, in this case, template strings provide a major usability advantage to format strings in that you don’t have to remember a bunch of type placeholders and there is a compelling reason why they can’t be used so I feel it would be useful. I’m happy if we do so without the link if you feel the link would add more confusion than clarity :) |
@aral yeah if you don't have a more specific link handy, I would just omit the link |
writing-apps/code-style.md
Outdated
@@ -310,7 +310,7 @@ print ("Hello World"); | |||
|
|||
## String Formatting | |||
|
|||
Avoid using literals when formatting strings: | |||
Avoid using literals when formatting strings, as they cannot be [localized](https://wiki.gnome.org/TranslationProject/DevGuidelines): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about using "translated" instead of "localised"? That would not need any link.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there, feels like localized is more precise. The strings can be translated (if someone translates them) but they cannot be localized (ie., those translations cannot be used within the app).
Perhaps: “…as they will not appear in the list of translatable strings for localization.”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, not sure. I am trying to find a non-technical wording so that no explanatory link is necessary. How about something like "... as any translation of them will not appear in the app"
@aral Are you in a position to progress this? |
Will do. |
Thanks - don't forget to resolve the conflicts with master. |
Specifically, because they cannot be localised.