DEV: I18n all the things
This commit is contained in:
		
							parent
							
								
									f9f5f5d1ff
								
							
						
					
					
						commit
						17f726e853
					
				|  | @ -19,22 +19,22 @@ | ||||||
| 
 | 
 | ||||||
|   <td> |   <td> | ||||||
|     {{#if @repo.checkingStatus}} |     {{#if @repo.checkingStatus}} | ||||||
|       Checking for new version... |       {{i18n "admin.docker.checking"}} | ||||||
|     {{else if @repo.upToDate}} |     {{else if @repo.upToDate}} | ||||||
|       Up to date |       {{i18n "admin.docker.up_to_date"}} | ||||||
|     {{else}} |     {{else}} | ||||||
|       <div class="new-version"> |       <div class="new-version"> | ||||||
|         <h4>New Version Available!</h4> |         <h4>{{i18n "admin.docker.new_version_available"}}</h4> | ||||||
| 
 | 
 | ||||||
|         <ul> |         <ul> | ||||||
|           <li> |           <li> | ||||||
|             Remote Version: |             {{i18n "admin.docker.latest_version"}} | ||||||
|             <span class="new commit-hash" title={{@repo.latestVersion}}> |             <span class="new commit-hash" title={{@repo.latestVersion}}> | ||||||
|               {{@repo.prettyLatestVersion}} |               {{@repo.prettyLatestVersion}} | ||||||
|             </span> |             </span> | ||||||
|           </li> |           </li> | ||||||
|           <li> |           <li> | ||||||
|             Last Updated: |             {{i18n "admin.docker.last_updated"}} | ||||||
|             {{#if @repo.latest.date}} |             {{#if @repo.latest.date}} | ||||||
|               {{format-date @repo.latest.date}} |               {{format-date @repo.latest.date}} | ||||||
|             {{else}} |             {{else}} | ||||||
|  |  | ||||||
|  | @ -1,6 +1,7 @@ | ||||||
| import Component from "@glimmer/component"; | import Component from "@glimmer/component"; | ||||||
| import { inject as service } from "@ember/service"; | import { inject as service } from "@ember/service"; | ||||||
| import { action } from "@ember/object"; | import { action } from "@ember/object"; | ||||||
|  | import I18n from "I18n"; | ||||||
| 
 | 
 | ||||||
| export default class RepoStatus extends Component { | export default class RepoStatus extends Component { | ||||||
|   @service router; |   @service router; | ||||||
|  | @ -30,17 +31,17 @@ export default class RepoStatus extends Component { | ||||||
| 
 | 
 | ||||||
|   get officialRepoBadgeTitle() { |   get officialRepoBadgeTitle() { | ||||||
|     if (this.args.repo.fork) { |     if (this.args.repo.fork) { | ||||||
|       return "Forked Official Plugin"; |       return I18n.t("admin.docker.forked_plugin"); | ||||||
|     } else if (this.args.repo.official) { |     } else if (this.args.repo.official) { | ||||||
|       return "Official Plugin"; |       return I18n.t("admin.docker.official_plugin"); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   get upgradeButtonLabel() { |   get upgradeButtonLabel() { | ||||||
|     if (this.args.repo.upgrading) { |     if (this.args.repo.upgrading) { | ||||||
|       return "Currently Upgrading…"; |       return I18n.t("admin.docker.upgrading"); | ||||||
|     } else { |     } else { | ||||||
|       return "Upgrade"; |       return I18n.t("admin.docker.upgrade_action"); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -1,12 +1,13 @@ | ||||||
| {{#if this.currentUser.admin}} | {{#if this.currentUser.admin}} | ||||||
|   {{#if @versionCheck.upToDate}} |   {{#if @versionCheck.upToDate}} | ||||||
|     <LinkTo @route="upgrade"> |     <LinkTo @route="upgrade"> | ||||||
|       {{i18n "docker.link_to_upgrade"}} |       {{i18n "admin.docker.link_to_upgrade"}} | ||||||
|     </LinkTo> |     </LinkTo> | ||||||
|   {{else}} |   {{else}} | ||||||
|     {{i18n "docker.upgrade"}} |     {{i18n "admin.docker.outdated_notice"}} | ||||||
|  | 
 | ||||||
|     <LinkTo @route="upgrade"> |     <LinkTo @route="upgrade"> | ||||||
|       {{i18n "docker.perform_upgrade"}} |       {{i18n "admin.docker.perform_upgrade"}} | ||||||
|     </LinkTo> |     </LinkTo> | ||||||
|   {{/if}} |   {{/if}} | ||||||
| {{/if}} | {{/if}} | ||||||
|  |  | ||||||
|  | @ -4,6 +4,7 @@ import { inject as service } from "@ember/service"; | ||||||
| import { tracked } from "@glimmer/tracking"; | import { tracked } from "@glimmer/tracking"; | ||||||
| import { equal } from "@ember/object/computed"; | import { equal } from "@ember/object/computed"; | ||||||
| import { action } from "@ember/object"; | import { action } from "@ember/object"; | ||||||
|  | import I18n from "I18n"; | ||||||
| 
 | 
 | ||||||
| export default class UpgradeShow extends Controller { | export default class UpgradeShow extends Controller { | ||||||
|   @service messageBus; |   @service messageBus; | ||||||
|  | @ -36,14 +37,6 @@ export default class UpgradeShow extends Controller { | ||||||
|     return this.isMultiple ? this.model : [this.model]; |     return this.isMultiple ? this.model : [this.model]; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   get upgradeButtonText() { |  | ||||||
|     if (this.upgrading) { |  | ||||||
|       return "Upgrading..."; |  | ||||||
|     } else { |  | ||||||
|       return "Start Upgrading"; |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   updateAttribute(key, value, valueIsKey = false) { |   updateAttribute(key, value, valueIsKey = false) { | ||||||
|     this.model.forEach((repo) => { |     this.model.forEach((repo) => { | ||||||
|       value = valueIsKey ? repo[value] : value; |       value = valueIsKey ? repo[value] : value; | ||||||
|  | @ -116,10 +109,7 @@ export default class UpgradeShow extends Controller { | ||||||
| 
 | 
 | ||||||
|   @action |   @action | ||||||
|   resetUpgrade() { |   resetUpgrade() { | ||||||
|     const message = ` |     const message = I18n.t("admin.docker.reset_warning"); | ||||||
|       WARNING: You should only reset upgrades that have failed and are not running. |  | ||||||
|       This will NOT cancel currently running builds and should only be used as a last resort. |  | ||||||
|     `;
 |  | ||||||
| 
 | 
 | ||||||
|     this.dialog.confirm({ |     this.dialog.confirm({ | ||||||
|       message, |       message, | ||||||
|  |  | ||||||
|  | @ -1,5 +1,6 @@ | ||||||
| import { helper as buildHelper } from "@ember/component/helper"; | import { helper as buildHelper } from "@ember/component/helper"; | ||||||
| import { htmlSafe } from "@ember/template"; | import { htmlSafe } from "@ember/template"; | ||||||
|  | import I18n from "I18n"; | ||||||
| 
 | 
 | ||||||
| export default buildHelper(function (params) { | export default buildHelper(function (params) { | ||||||
|   const [commitsBehind, oldSha, newSha, url] = params; |   const [commitsBehind, oldSha, newSha, url] = params; | ||||||
|  | @ -12,9 +13,9 @@ export default buildHelper(function (params) { | ||||||
|     return ""; |     return ""; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   let description = `${commitsBehind} new commit${ |   let description = I18n.t("admin.docker.commits", { | ||||||
|     commitsBehind === 1 ? "" : "s" |     count: commitsBehind, | ||||||
|   }`;
 |   }); | ||||||
| 
 | 
 | ||||||
|   if (!url) { |   if (!url) { | ||||||
|     return description; |     return description; | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| <h1>Upgrade</h1> | <h1>{{i18n "admin.docker.upgrade_title"}}</h1> | ||||||
| 
 | 
 | ||||||
| <button | <button | ||||||
|   disabled={{upgradeAllButtonDisabled}} |   disabled={{upgradeAllButtonDisabled}} | ||||||
|  | @ -7,17 +7,17 @@ | ||||||
|   {{action "upgradeAllButton"}} |   {{action "upgradeAllButton"}} | ||||||
| > | > | ||||||
|   {{#if allUpToDate}} |   {{#if allUpToDate}} | ||||||
|     All Up-to-date |     {{i18n "admin.docker.all_up_to_date"}} | ||||||
|   {{else}} |   {{else}} | ||||||
|     Upgrade All |     {{i18n "admin.docker.upgrade_all"}} | ||||||
|   {{/if}} |   {{/if}} | ||||||
| </button> | </button> | ||||||
| 
 | 
 | ||||||
| <table class="table" id="repos"> | <table class="table" id="repos"> | ||||||
|   <thead> |   <thead> | ||||||
|     <th></th> |     <th></th> | ||||||
|     <th style="width: 50%">Repository</th> |     <th style="width: 50%">{{i18n "admin.docker.repository"}}</th> | ||||||
|     <th>Status</th> |     <th>{{i18n "admin.docker.status"}}</th> | ||||||
|   </thead> |   </thead> | ||||||
|   <tbody> |   <tbody> | ||||||
|     {{#each this.model as |repo|}} |     {{#each this.model as |repo|}} | ||||||
|  |  | ||||||
|  | @ -1,27 +1,31 @@ | ||||||
| <h3>Upgrade {{this.title}}</h3> | <h3>{{i18n "admin.docker.upgrade_repo" name=this.title}}</h3> | ||||||
| 
 | 
 | ||||||
| <ProgressBar @percent={{this.percent}} /> | <ProgressBar @percent={{this.percent}} /> | ||||||
| 
 | 
 | ||||||
| {{#if this.complete}} | {{#if this.complete}} | ||||||
|   <p>Upgrade completed successfully!</p> |   <p>{{i18n "admin.docker.upgrade_successful"}}</p> | ||||||
| {{else if this.failed}} | {{else if this.failed}} | ||||||
|   <p>Sorry, there was an error upgrading Discourse. Please check the logs below.</p> |   <p>{{i18n "admin.docker.upgrade_error"}}</p> | ||||||
| {{/if}} | {{/if}} | ||||||
| 
 | 
 | ||||||
| {{#if this.isUpToDate}} | {{#if this.isUpToDate}} | ||||||
|   {{#unless this.multiUpgrade}} |   {{#unless this.multiUpgrade}} | ||||||
|     <p>{{this.title}} is at the newest version.</p> |     <p>{{i18n "admin.docker.repo_newest_version" name=this.title}}</p> | ||||||
|   {{else}} |   {{else}} | ||||||
|     <p>Everything is up-to-date.</p> |     <p>{{i18n "admin.docker.everything_up_to_date"}}</p> | ||||||
|   {{/unless}} |   {{/unless}} | ||||||
| {{else}} | {{else}} | ||||||
|   <button {{on "click" this.start}} disabled={{this.upgrading}} class="btn"> |   <button {{on "click" this.start}} disabled={{this.upgrading}} class="btn"> | ||||||
|     {{upgradeButtonText}} |     {{#if this.upgrading}} | ||||||
|  |       {{i18n "admin.docker.upgrading"}} | ||||||
|  |     {{else}} | ||||||
|  |       {{i18n "admin.docker.start_upgrading"}} | ||||||
|  |     {{/if}} | ||||||
|   </button> |   </button> | ||||||
| 
 | 
 | ||||||
|   {{#if this.upgrading}} |   {{#if this.upgrading}} | ||||||
|     <button {{on "click" this.resetUpgrade}} class="btn unlock"> |     <button {{on "click" this.resetUpgrade}} class="btn unlock"> | ||||||
|       Reset Upgrade |       {{i18n "admin.docker.reset_upgrade"}} | ||||||
|     </button> |     </button> | ||||||
|   {{/if}} |   {{/if}} | ||||||
| {{/if}} | {{/if}} | ||||||
|  |  | ||||||
|  | @ -1,12 +1,37 @@ | ||||||
| en: | en: | ||||||
|   js: |   js: | ||||||
|     admin: |     admin: | ||||||
|  |       docker: | ||||||
|  |         all_up_to_date: "All Up-to-date" | ||||||
|  |         checking: "Checking for new version…" | ||||||
|  |         commits: | ||||||
|  |           one: "%{count} new commit" | ||||||
|  |           other: "%{count} new commits" | ||||||
|  |         everything_up_to_date: "Everything is up-to-date" | ||||||
|  |         forked_plugin: "Forked Official Plugin" | ||||||
|  |         last_updated: "Last Updated:" | ||||||
|  |         latest_version: "Latest Version:" | ||||||
|  |         link_to_upgrade: "Perform upgrades here" | ||||||
|  |         new_version_available: "New Version Available!" | ||||||
|  |         official_plugin: "Official Plugin" | ||||||
|  |         outdated_notice: "Your Discourse installation is out of date" | ||||||
|  |         perform_upgrade: "Click here to upgrade." | ||||||
|  |         repo_newest_version: "%{name} is at the newest version." | ||||||
|  |         repository: "Repository" | ||||||
|  |         reset_upgrade: "Reset Upgrade" | ||||||
|  |         reset_warning: "WARNING: You should only reset upgrades that have failed and are not running. This will NOT cancel currently running builds and should only be used as a last resort." | ||||||
|  |         start_upgrading: "Start Upgrading" | ||||||
|  |         status: "Status" | ||||||
|  |         up_to_date: "Up to date" | ||||||
|  |         upgrade_action: "Upgrade" | ||||||
|  |         upgrade_all: "Upgrade All" | ||||||
|  |         upgrade_error: "Sorry, there was an error upgrading Discourse. Please check the logs below." | ||||||
|  |         upgrade_repo: "Upgrade %{name}" | ||||||
|  |         upgrade_successful: "Upgrade completed successfully!" | ||||||
|  |         upgrade_title: "Upgrade" | ||||||
|  |         upgrading: "Upgrading…" | ||||||
|  | 
 | ||||||
|       logs: |       logs: | ||||||
|         staff_actions: |         staff_actions: | ||||||
|           actions: |           actions: | ||||||
|             discourse_upgrade: "Upgrade to the Latest Version" |             discourse_upgrade: "Upgrade to the latest version" | ||||||
| 
 |  | ||||||
|     docker: |  | ||||||
|       upgrade: "Your Discourse installation is out of date." |  | ||||||
|       perform_upgrade: "Click here to upgrade." |  | ||||||
|       link_to_upgrade: "Perform upgrades here." |  | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue