Skip to content

Commit

Permalink
Fix translation extraction
Browse files Browse the repository at this point in the history
Signed-off-by: Jonas Rittershofer <[email protected]>
  • Loading branch information
jotoeri committed Mar 28, 2021
1 parent d5f3698 commit 50e88a1
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 10 deletions.
4 changes: 2 additions & 2 deletions build/extract-l10n.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ extractor
}),
JsExtractors.callExpression('n', {
arguments: {
text: 1,
textPlural: 2,
text: 0,
textPlural: 1,
}
}),
])
Expand Down
6 changes: 6 additions & 0 deletions l10n/messages.pot
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ msgstr ""
msgid "Custom"
msgstr ""

msgid "External documentation for {title}"
msgstr ""

msgid "Flags"
msgstr ""

Expand Down Expand Up @@ -83,6 +86,9 @@ msgstr ""
msgid "Start slideshow"
msgstr ""

msgid "Submit"
msgstr ""

msgid "Symbols"
msgstr ""

Expand Down
7 changes: 3 additions & 4 deletions src/components/AppSidebar/AppSidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
class="app-sidebar-header">
<!-- close sidebar button -->
<a
v-tooltip.auto="t('close')"
v-tooltip.auto="closeTranslated"
href="#"
class="app-sidebar__close icon-close"
@click.prevent="closeSidebar" />
Expand Down Expand Up @@ -237,9 +237,9 @@ import Actions from '../Actions'
import Focus from '../../directives/Focus'
import Linkify from '../../directives/Linkify'
import Tooltip from '../../directives/Tooltip'
import l10n from '../../mixins/l10n'
import AppSidebarTabs from './AppSidebarTabs'
import EmptyContent from '../EmptyContent/EmptyContent'
import { t } from '../../l10n'
import { directive as ClickOutside } from 'v-click-outside'
export default {
Expand All @@ -258,8 +258,6 @@ export default {
Tooltip,
},
mixins: [l10n],
props: {
active: {
type: String,
Expand Down Expand Up @@ -365,6 +363,7 @@ export default {
data() {
return {
closeTranslated: t('Close'),
isStarred: this.starred,
}
},
Expand Down
11 changes: 10 additions & 1 deletion src/components/SettingsInputText/SettingsInputText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@input="onInput"
@change="onChange">
<input :id="idSubmit"
:value="t('Submit')"
:value="submitTranslated"
type="submit"
class="action-input__submit">
<label v-show="!disabled" :for="idSubmit" class="action-input__label" />
Expand All @@ -45,7 +45,9 @@
</template>

<script>
import { t } from '../../l10n'
import GenRandomId from '../../utils/GenRandomId'
export default {
name: 'SettingsInputText',
props: {
Expand Down Expand Up @@ -90,6 +92,13 @@ export default {
validator: id => id.trim() !== '',
},
},
data() {
return {
submitTranslated: t('Submit'),
}
},
computed: {
/**
* @returns {string}
Expand Down
14 changes: 11 additions & 3 deletions src/components/SettingsSection/SettingsSection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ This component is to be used in the settings section of nextcloud.
:href="docUrl"
class="settings-section__info"
role=""
:title="t('External documentation for {title}', {title})" />
:title="docTitleTranslated" />
</h2>
<p v-if="hasDescription"
class="settings-section__desc">
Expand All @@ -59,14 +59,14 @@ This component is to be used in the settings section of nextcloud.
</template>

<script>
import l10n from '../../mixins/l10n'
import { t } from '../../l10n'
export default {
name: 'SettingsSection',
components: {
},
mixins: [l10n],
props: {
title: {
type: String,
Expand All @@ -82,6 +82,14 @@ export default {
},
},
data() {
return {
docTitleTranslated: t('External documentation for {title}', {
title: this.title,
}),
}
},
computed: {
hasDescription() {
return this.description.length > 0
Expand Down

0 comments on commit 50e88a1

Please sign in to comment.