Skip to content

Commit f773577

Browse files
committed
Fix locale and license text generation regressions
1 parent d2a1af9 commit f773577

File tree

11 files changed

+24
-462
lines changed

11 files changed

+24
-462
lines changed

src/components/CopyTools.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
@change-copy-type="changeCopyType"
66
/>
77
<v-button
8-
class="donate small copy-button"
98
v-if="clipboardTarget!=='.xmp'"
9+
class="donate small copy-button"
1010
:data-clipboard-target="clipboardTarget"
1111
@click="handleCopy"
1212
>
@@ -104,7 +104,6 @@ export default {
104104
padding: 0 1.5rem 1.5rem;
105105
}
106106
.button.donate.small {
107-
width: 5rem;
108107
justify-content: center;
109108
&.is-xmp {
110109
width: fit-content;

src/components/LicenseText.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
</template>
1717
<template #creator>
1818
<component
19-
:is="creatorName && creatorProfileUrl && isWeb ? 'a' : 'span'"
19+
:is="isCreatorLink ? 'a' : 'span'"
2020
v-if="creatorName"
2121
v-bind="creatorProps"
2222
>
2323
{{ creatorName }}
2424
</component>
2525
</template>
2626
<template #by>
27-
{{ $t(byString) }}
27+
{{ byString }}
2828
</template>
2929
<template #licenseMark>
3030
<span>{{ $t(licensedMarkedString) }}</span>
@@ -45,7 +45,7 @@
4545
<span v-else>{{ licenseName }}.</span>
4646
</template>
4747
<template #print-instructions>
48-
<span v-if="!isWeb">{{ $t('license-use.print.text', {linkToLicenseDeed: licenseUrl('print')}) }}</span>
48+
<span v-if="!isWeb">{{ $t('license-use.print.text', { linkToLicenseDeed: licenseUrl('print') }) }}</span>
4949
</template>
5050
</i18n>
5151
</template>
@@ -66,9 +66,6 @@ export default {
6666
validate: function(val) {
6767
return ['web', 'print'].indexOf(val) > -1
6868
}
69-
},
70-
ltid: {
71-
type: String
7269
}
7370
},
7471
computed: {
@@ -77,15 +74,18 @@ export default {
7774
licensedMarkedString() {
7875
return this.shortName === 'CC0 1.0' ? 'license-use.richtext.marked-text' : 'license-use.richtext.licensed-text'
7976
},
77+
isCreatorLink() {
78+
return this.creatorName && this.creatorProfileUrl && this.isWeb
79+
},
8080
licenseName() {
8181
return this.attributionType === 'short' ? this.shortName : this.fullName
8282
},
8383
byString() {
84-
return this.creatorName ? 'license-use.richtext.by' : ''
84+
return this.creatorName ? this.$t('license-use.richtext.by') : ''
8585
},
8686
creatorProps() {
8787
const creatorAttrs = { property: 'cc:attributionName' }
88-
if (this.creatorName && this.creatorProfileUrl && this.isWeb) {
88+
if (this.isCreatorLink) {
8989
creatorAttrs.href = this.creatorProfileUrl
9090
creatorAttrs.rel = 'cc:attributionURL'
9191
}

src/i18n.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import VueI18n from 'vue-i18n'
44
Vue.use(VueI18n)
55

66
function loadLocaleMessages() {
7-
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.js$/i)
7+
const locales = require.context('./locales', true, /[A-Za-z0-9-_,\s]+\.json$/i)
88
const messages = {}
99
locales.keys().forEach(key => {
1010
const matched = key.match(/([A-Za-z0-9-_]+)\./i)
1111
if (matched && matched.length > 1) {
1212
const locale = matched[1]
13-
messages[locale] = locales(key).messages
13+
messages[locale] = locales(key)
1414
}
1515
})
1616
return messages

src/locales/en.js

Lines changed: 0 additions & 221 deletions
This file was deleted.

src/locales/en.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,24 +107,28 @@
107107
}
108108
},
109109
"license-use": {
110-
"heading": "Use your license",
111-
"common-instructions": "Choose what kind of work you are licensing to get appropriate license code.",
112-
"web-instructions": "If you are licensing one work, paste the code next to it. If you are licensing the whole page or blog, you can paste the license code at the bottom of the page.",
110+
"heading": "Mark your work",
111+
"common-instructions": "Choose what kind of work to get appropriate license code or public domain marking.",
112+
"web-instructions": "If you are licensing or marking one work, paste the code next to it. If you are licensing the whole page or blog, you can paste the license code at the bottom of the page.",
113113
"web-tab-heading": "Website",
114114
"print-media-tab-heading": "Print Work or Media",
115115
"print-media-instructions": "Copy the text below and paste it on the title and/or copyright page of your print work or presentation, or in the credits of your media.",
116116
"rich-text-label": "Rich Text",
117117
"html-label": "HTML",
118118
"plain-text-label": "Plain Text",
119+
"xmp-label": "Download meta data XMP",
119120
"copy-label": "Copy",
120121
"copied-label": "Copied!",
121122
"richtext": {
122-
"full-text": "{workTitle} {byCreator} {licenseMark} {license}",
123+
"full-text": "{workTitle} {by} {creator}{licenseMark} {license}{print-instructions}",
123124
"workTitle": "This work",
124125
"by": "by",
125126
"licensed-text": "is licensed under",
126127
"marked-text": "is marked with",
127128
"print-instructions": ". To view a copy of this license, visit {linkToLicenseDeed}"
129+
},
130+
"print": {
131+
"text": " To view a copy of this license, visit {linkToLicenseDeed}"
128132
}
129133
},
130134
"help": {

0 commit comments

Comments
 (0)