Skip to content

Commit

Permalink
3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
smcyr committed May 4, 2022
1 parent 6f31df5 commit 3b49cdf
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## 3.0.0 - 2022-05-04

### Changed
- Show the languages in the current Control Panel language with the native name after (same behavior as the language menu in the Sites Settings page)

## 3.0.0-beta.1 - 2022-04-20

### Added
Expand Down
8 changes: 6 additions & 2 deletions assets/components/TranslationsList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
<th :style="'width: ' + (96/(checkedLanguages.length + 1)) + '%'">{{ t('Key') }}</th>
<th v-for="language in checkedLanguages" v-bind:key="language.id"
:style="'width: ' + (96/(checkedLanguages.length + 1)) + '%'">
{{ language.displayName }}
<span>{{ language.displayName }}</span>
<span class="light" v-if="language.nativeName"> – {{ language.nativeName }}</span>
</th>
</tr>
</thead>
Expand All @@ -40,7 +41,10 @@
<td v-for="language in checkedLanguages" v-bind:key="language.id"
:class="{'modified': !isNullOrUndefined(sourceMessage.isModified) &&
sourceMessage.isModified[language.id] === true}">
<div class="mobile-only cell-label">{{ language.displayName }}</div>
<div class="mobile-only cell-label">
<span>{{ language.displayName }}</span>
<span class="light" v-if="language.nativeName"> – {{ language.nativeName }}</span>
</div>
<div class="message-text">
<textarea class="text nicetext fullwidth"
v-model="sourceMessage.languages[language.id]"
Expand Down
5 changes: 4 additions & 1 deletion assets/components/TranslationsToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@
type="checkbox"
:checked="languages[language.id].checked"
@input="updateLanguages(language.id, $event.target.checked)">
<label :for="`language-checkbox-${language.id}`">{{ language.displayName }}</label>
<label :for="`language-checkbox-${language.id}`">
<span>{{ language.displayName }}</span>
<span class="light" v-if="language.nativeName"> – {{ language.nativeName }}</span>
</label>
</li>
</ul>
</div>
Expand Down
9 changes: 6 additions & 3 deletions src/controllers/MessagesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,13 @@ public function actionGetTranslations()

return $this->asJson([
'languages' => array_map(
function ($lang) {
function ($locale) {
return [
'id' => $lang->id,
'displayName' => $lang->displayName
'id' => $locale->id,
'displayName' => $locale->getDisplayName(Craft::$app->language),
'nativeName' => $locale->getLanguageID() !== Craft::$app->getLocale()->getLanguageID()
? $locale->getDisplayName()
: false
];
},
$siteLocales
Expand Down
4 changes: 2 additions & 2 deletions src/resources/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/resources/main.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/resources/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/resources/main.js.map

Large diffs are not rendered by default.

0 comments on commit 3b49cdf

Please sign in to comment.