8000 Feat locale refactor by christyjacob4 · Pull Request #1422 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 21 commits into from
Jul 27, 2021
Merged

Feat locale refactor #1422

merged 21 commits into from
Jul 27, 2021

Conversation

christyjacob4
Copy link
Member
@christyjacob4 christyjacob4 commented Jul 22, 2021

What does this PR do?

  • Refactor all the locale templates
  • Use the new email templates instead of passing a path to Template() in

$content = new Template(__DIR__.'/../../config/locale/translations/templates/'.$locale->getText('account.emails.verification.body'));

Test Plan

Use Existing tests

Related PRs and Issues

NA

Have you read the Contributing Guidelines on issues?

YES

@christyjacob4 christyjacob4 force-pushed the feat-locale-refactor branch from 68b4085 to b911673 Compare July 23, 2021 08:02
* @return string
*
*/
public function getHtml(): string
Copy link
Member

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'));
Copy link
Member

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 :)

Copy link
Member

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 :)

Copy link
Member Author

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 👍

@christyjacob4 christyjacob4 changed the base branch from master to locale July 27, 2021 20:32
christyjacob4 and others added 2 commits July 28, 2021 02:21
@christyjacob4 christyjacob4 merged commit 1f61177 into locale Jul 27, 2021
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.

2 participants
0