forked from AkkomaGang/akkoma-fe
Merge branch 'develop' into fix/convert-more-hyperlinks-to-buttons
This commit is contained in:
commit
daa9f211a6
6 changed files with 37 additions and 18 deletions
|
@ -18,6 +18,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- Don't filter own posts when they hit your wordfilter
|
- Don't filter own posts when they hit your wordfilter
|
||||||
|
- Language picker now uses native language names
|
||||||
|
|
||||||
|
|
||||||
## [2.2.2] - 2020-12-22
|
## [2.2.2] - 2020-12-22
|
||||||
|
|
|
@ -12,11 +12,11 @@
|
||||||
v-model="language"
|
v-model="language"
|
||||||
>
|
>
|
||||||
<option
|
<option
|
||||||
v-for="(langCode, i) in languageCodes"
|
v-for="lang in languages"
|
||||||
:key="langCode"
|
:key="lang.code"
|
||||||
:value="langCode"
|
:value="lang.code"
|
||||||
>
|
>
|
||||||
{{ languageNames[i] }}
|
{{ lang.name }}
|
||||||
</option>
|
</option>
|
||||||
</select>
|
</select>
|
||||||
<FAIcon
|
<FAIcon
|
||||||
|
@ -29,6 +29,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import languagesObject from '../../i18n/messages'
|
import languagesObject from '../../i18n/messages'
|
||||||
|
import localeService from '../../services/locale/locale.service.js'
|
||||||
import ISO6391 from 'iso-639-1'
|
import ISO6391 from 'iso-639-1'
|
||||||
import _ from 'lodash'
|
import _ from 'lodash'
|
||||||
import { library } from '@fortawesome/fontawesome-svg-core'
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
||||||
|
@ -42,12 +43,8 @@ library.add(
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
languageCodes () {
|
languages () {
|
||||||
return languagesObject.languages
|
return _.map(languagesObject.languages, (code) => ({ code: code, name: this.getLanguageName(code) })).sort((a, b) => a.name.localeCompare(b.name))
|
||||||
},
|
|
||||||
|
|
||||||
languageNames () {
|
|
||||||
return _.map(this.languageCodes, this.getLanguageName)
|
|
||||||
},
|
},
|
||||||
|
|
||||||
language: {
|
language: {
|
||||||
|
@ -61,12 +58,13 @@ export default {
|
||||||
methods: {
|
methods: {
|
||||||
getLanguageName (code) {
|
getLanguageName (code) {
|
||||||
const specialLanguageNames = {
|
const specialLanguageNames = {
|
||||||
'ja': 'Japanese (日本語)',
|
'ja_easy': 'やさしいにほんご',
|
||||||
'ja_easy': 'Japanese (やさしいにほんご)',
|
'zh': '简体中文',
|
||||||
'zh': 'Simplified Chinese (简体中文)',
|
'zh_Hant': '繁體中文'
|
||||||
'zh_Hant': 'Traditional Chinese (繁體中文)'
|
|
||||||
}
|
}
|
||||||
return specialLanguageNames[code] || ISO6391.getName(code)
|
const languageName = specialLanguageNames[code] || ISO6391.getNativeName(code)
|
||||||
|
const browserLocale = localeService.internalToBrowserLocale(code)
|
||||||
|
return languageName.charAt(0).toLocaleUpperCase(browserLocale) + languageName.slice(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,7 @@
|
||||||
v-if="!!visibleRole"
|
v-if="!!visibleRole"
|
||||||
class="alert user-role"
|
class="alert user-role"
|
||||||
>
|
>
|
||||||
{{ visibleRole }}
|
{{ $t(`user_card.roles.${visibleRole}`) }}
|
||||||
</span>
|
</span>
|
||||||
<span
|
<span
|
||||||
v-if="user.bot"
|
v-if="user.bot"
|
||||||
|
@ -507,7 +507,6 @@
|
||||||
|
|
||||||
.user-role {
|
.user-role {
|
||||||
flex: none;
|
flex: none;
|
||||||
text-transform: capitalize;
|
|
||||||
color: $fallback--text;
|
color: $fallback--text;
|
||||||
color: var(--alertNeutralText, $fallback--text);
|
color: var(--alertNeutralText, $fallback--text);
|
||||||
background-color: $fallback--fg;
|
background-color: $fallback--fg;
|
||||||
|
|
|
@ -729,6 +729,10 @@
|
||||||
"quarantine": "Disallow user posts from federating",
|
"quarantine": "Disallow user posts from federating",
|
||||||
"delete_user": "Delete user",
|
"delete_user": "Delete user",
|
||||||
"delete_user_confirmation": "Are you absolutely sure? This action cannot be undone."
|
"delete_user_confirmation": "Are you absolutely sure? This action cannot be undone."
|
||||||
|
},
|
||||||
|
"roles": {
|
||||||
|
"admin": "Admin",
|
||||||
|
"moderator": "Moderator"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"user_profile": {
|
"user_profile": {
|
||||||
|
|
|
@ -188,7 +188,12 @@ export const parseUser = (data) => {
|
||||||
output.follow_request_count = data.pleroma.follow_request_count
|
output.follow_request_count = data.pleroma.follow_request_count
|
||||||
|
|
||||||
output.tags = data.pleroma.tags
|
output.tags = data.pleroma.tags
|
||||||
output.deactivated = data.pleroma.deactivated
|
|
||||||
|
// deactivated was changed to is_active in Pleroma 2.3.0
|
||||||
|
// so check if is_active is present
|
||||||
|
output.deactivated = typeof data.pleroma.is_active !== 'undefined'
|
||||||
|
? !data.pleroma.is_active // new backend
|
||||||
|
: data.pleroma.deactivated // old backend
|
||||||
|
|
||||||
output.notification_settings = data.pleroma.notification_settings
|
output.notification_settings = data.pleroma.notification_settings
|
||||||
output.unread_chat_count = data.pleroma.unread_chat_count
|
output.unread_chat_count = data.pleroma.unread_chat_count
|
||||||
|
|
12
src/services/locale/locale.service.js
Normal file
12
src/services/locale/locale.service.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
const specialLanguageCodes = {
|
||||||
|
'ja_easy': 'ja',
|
||||||
|
'zh_Hant': 'zh-HANT'
|
||||||
|
}
|
||||||
|
|
||||||
|
const internalToBrowserLocale = code => specialLanguageCodes[code] || code
|
||||||
|
|
||||||
|
const localeService = {
|
||||||
|
internalToBrowserLocale
|
||||||
|
}
|
||||||
|
|
||||||
|
export default localeService
|
Loading…
Reference in a new issue