-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Added support for variables in nunjucks templates for translate filter #2397
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -52,7 +52,8 @@ Module.register("weather", { | |
| onlyTemp: false, | ||
| showPrecipitationAmount: false, | ||
| colored: false, | ||
| showFeelsLike: true | ||
| showFeelsLike: true, | ||
| feelsLikeWithDegree: false | ||
| }, | ||
|
|
||
| // Module properties. | ||
|
|
@@ -88,6 +89,8 @@ Module.register("weather", { | |
| // Let the weather provider know we are starting. | ||
| this.weatherProvider.start(); | ||
|
|
||
| this.config.feelsLikeWithDegree = this.translate("FEELS").indexOf("{DEGREE}") > -1; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. with DEGREE in all translations this would not be necessary either
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would suggest to keep it as it is. As it is optional and very few languages will need DEGREE placeholder. If we add DEGREE placeholder it might break other modules who are using FEELS like resource string in their modules. New languages (Hindi and Gujarati) only have it now and if any third party is using it they need to correct it for this lang. only. |
||
|
|
||
| // Add custom filters | ||
| this.addFilters(); | ||
|
|
||
|
|
||
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.
I'd rather add the DEGREE placeholder in all other translations too, so we can get rid of these if clauses.