-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Feat locale refactor #1422
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
Feat locale refactor #1422
Conversation
68b4085
to
b911673
Compare
src/Appwrite/Template/Template.php
Outdated
* @return string | ||
* | ||
*/ | ||
public function getHtml(): string |
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.
Again as the above comment, not sure why we need dedicated setters as getters, seems like there is no much code repetitiveness this is saving us. Probably better avoid coupling with HTML, this template can be used with any view format.
@@ -42,7 +40,8 @@ | |||
|
|||
if ($record) { | |||
$output['countryCode'] = $record['country']['iso_code']; | |||
$output['country'] = (isset($countries[$record['country']['iso_code']])) ? $countries[$record['country']['iso_code']] : $locale->getText('locale.country.unknown'); | |||
$output['country'] = $locale->getText('countries.'.strtolower($record['country']['iso_code']), $locale->getText('locale.country.unknown')); |
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.
Why did we gave up the isset method check? We better be safe than sorry :)
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.
This has multiple instances across the diff, I'll avoid commenting on each one :)
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.
$locale->getText()
takes a default param. So I thought we can use that instead 👍
Remove CTA template and move logic to mails worker
What does this PR do?
Template()
inappwrite/app/controllers/api/account.php
Line 1723 in 16b3c5c
Test Plan
Use Existing tests
Related PRs and Issues
NA
Have you read the Contributing Guidelines on issues?
YES