Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable translations #541

Merged
merged 39 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
43c978c
start of i18n
ianopolous Feb 12, 2024
841c30a
Login component i18n'd
ianopolous Feb 12, 2024
bd2e9a1
more i18n
ianopolous Feb 12, 2024
c2803ce
i18n free signup
ianopolous Feb 12, 2024
e598976
fallback to en-GB if language is missing a mapping
ianopolous Feb 12, 2024
7967c28
complete signup i18n
ianopolous Feb 12, 2024
a844975
password i18n
ianopolous Feb 13, 2024
c0ebe21
tour i18n
ianopolous Feb 14, 2024
c05d802
Drive i18n
ianopolous Feb 14, 2024
5898c3f
more drive i18n
ianopolous Feb 16, 2024
a918117
drive i18n
ianopolous Feb 19, 2024
533614a
sidebar i18n
ianopolous Feb 19, 2024
fcd71ac
simplify password i18n
ianopolous Feb 20, 2024
a2de05a
this -> that in drive i18n
ianopolous Feb 20, 2024
cd1771e
search i18n
ianopolous Feb 20, 2024
39c4d8b
user menu i18n
ianopolous Feb 20, 2024
ab5fd5c
password change i18n
ianopolous Feb 20, 2024
231d3c5
mfs i18n
ianopolous Feb 21, 2024
2858a27
help i18n
ianopolous Feb 21, 2024
20cf568
feeedback i18n
ianopolous Feb 21, 2024
12e2d90
profile i18n
ianopolous Feb 21, 2024
f18b584
delete account i18n
ianopolous Feb 21, 2024
a455a8a
space i18n
ianopolous Feb 21, 2024
885fcda
paid i18n
ianopolous Feb 21, 2024
50b143d
sharing i18n
ianopolous Feb 21, 2024
465b8e0
link i18n
ianopolous Feb 21, 2024
17e9223
verification i18n
ianopolous Feb 21, 2024
95fb4c4
launcher i18n
ianopolous Feb 22, 2024
cc72a7e
Update jpack. Now peergos.js doesn't have duplicate entries!
ianopolous Feb 22, 2024
62288a9
social i18n
ianopolous Feb 22, 2024
8eac45d
newsfeed i18n
ianopolous Feb 22, 2024
34c9721
use java 17 in browser tests
ianopolous Feb 22, 2024
aac4346
tasks i18n
ianopolous Feb 22, 2024
b0a6d98
fix import
ianopolous Feb 22, 2024
53ea865
fix drive menu rename label
ianopolous Feb 22, 2024
3461037
fix tasks i18n
ianopolous Feb 22, 2024
be731f1
calendar header i18n
ianopolous Feb 22, 2024
7ed191e
Make drive table header sticky
ianopolous Feb 23, 2024
3975c7b
app sandbox i18n
ianopolous Feb 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/browser_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
uses: actions/setup-java@v3
with:
distribution: temurin
java-version: 11
java-version: 17
- uses: actions/setup-python@v2
with:
python-version: '3.11.0'
Expand Down
Binary file modified JPack.jar
Binary file not shown.
7 changes: 4 additions & 3 deletions src/components/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
<i>permanent</i> account, please go
<a class="line" href="https://peergos.net?signup=true">here</a>.
</p>
<AppTab title="Login">
<AppTab :title="translate('APP.LOGIN')">
<Login @initApp="init()" />
</AppTab>
<AppTab title="Signup">
<AppTab :title="translate('APP.SIGNUP')">
<Signup :token="token" />
</AppTab>
</AppTabs>
Expand Down Expand Up @@ -86,6 +86,7 @@ const ServerMessages = require("./ServerMessages.vue");
const routerMixins = require("../mixins/router/index.js");
const launcherMixin = require("../mixins/launcher/index.js");
const sandboxAppMixins = require("../mixins/sandbox/index.js");
const i18n = require("../i18n/index.js");

module.exports = {
components: {
Expand Down Expand Up @@ -150,7 +151,7 @@ module.exports = {
}
},

mixins: [routerMixins, sandboxAppMixins, launcherMixin],
mixins: [routerMixins, sandboxAppMixins, launcherMixin, i18n],

watch: {
network(newNetwork) {
Expand Down
11 changes: 6 additions & 5 deletions src/components/Login.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
autofocus
name="username"
v-model="username"
placeholder="Username"
:placeholder="translate('LOGIN.USERNAME')"
ref="username"
@input="(val) => (username = username.toLowerCase())"
/>
Expand All @@ -17,10 +17,10 @@
:consumer_cancel_func="consumer_cancel_func"
:consumer_func="consumer_func">
</MultiFactorAuth>
<FormPassword v-model="password" placeholder="password" @keyup.native.enter="login()"/>
<FormPassword v-model="password" :placeholder="translate('LOGIN.PASSWORD')" @keyup.native.enter="login()"/>

<label class="checkbox__group">
Stay logged in
{{ translate('LOGIN.STAY') }}
<input
type="checkbox"
name="stayLoggedIn"
Expand All @@ -30,7 +30,7 @@
</label>

<AppButton :disabled="isLoggingIn" class="login" @click.native="login()" type="primary" block accent icon="arrow-right">
Sign in
{{ translate('LOGIN.BUTTON') }}
</AppButton>
</div>
</template>
Expand All @@ -41,6 +41,7 @@ const FormPassword = require("./form/FormPassword.vue");
const MultiFactorAuth = require("./auth/MultiFactorAuth.vue");
const routerMixins = require("../mixins/router/index.js");
const UriDecoder = require('../mixins/uridecoder/index.js');
const i18n = require("../i18n/index.js");

module.exports = {
components: {
Expand Down Expand Up @@ -69,7 +70,7 @@ module.exports = {
'isSecretLink',
]),
},
mixins:[routerMixins, UriDecoder],
mixins:[routerMixins, UriDecoder, i18n],

mounted() {
this.$refs.username.focus()
Expand Down
44 changes: 23 additions & 21 deletions src/components/Search.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="modal-container search full-height" @click.stop style="overflow-y:auto">
<span @click="close" tabindex="0" v-on:keyup.enter="close" aria-label="close" class="close">&times;</span>
<div class="modal-header">
<h2>Search: {{ path }}</h2>
<h2>{{ translate("SEARCH.SEARCH") }}: {{ path }}</h2>
</div>
<div class="modal-body">
<div v-bind:class="errorClass">
Expand All @@ -14,15 +14,15 @@
<div class="flex-container">
<div class="flex-item search" style="margin: 10px; border-width: 1px; border-style: solid;">
<select v-model="selectedSearchType">
<option value="contains">Filename contains</option>
<option value="textContents">Text file contains</option>
<option value="modifiedAfter">File modified after</option>
<option value="modifiedBefore">File modified before</option>
<option value="createdAfter">File created after</option>
<option value="createdBefore">File created before</option>
<option value="fileSizeGreaterThan">File size greater than</option>
<option value="fileSizeLessThan">File size less than</option>
<option value="mimeType">File type</option>
<option value="contains">{{ translate("SEARCH.NAME.CONTAINS") }}</option>
<option value="textContents">{{ translate("SEARCH.TEXT.CONTAINS") }}</option>
<option value="modifiedAfter">{{ translate("SEARCH.MODIFIED.AFTER") }}</option>
<option value="modifiedBefore">{{ translate("SEARCH.MODIFIED.BEFORE") }}</option>
<option value="createdAfter">{{ translate("SEARCH.CREATED.AFTER") }}</option>
<option value="createdBefore">{{ translate("SEARCH.CREATED.BEFORE") }}</option>
<option value="fileSizeGreaterThan">{{ translate("SEARCH.SIZE.GREATER") }}</option>
<option value="fileSizeLessThan">{{ translate("SEARCH.SIZE.LESS") }}</option>
<option value="mimeType">{{ translate("SEARCH.TYPE") }}</option>
</select>
</div>
<div class="flex-item" v-if="selectedSearchType=='modifiedAfter' || selectedSearchType=='modifiedBefore' || selectedSearchType=='createdAfter' || selectedSearchType=='createdBefore'" style="margin: 10px;">
Expand All @@ -43,33 +43,33 @@
</div>
<div class="flex-item" v-if="selectedSearchType=='mimeType'" style="margin: 10px;">
<select v-model="selectedMimeType">
<option value="audio">Audio</option>
<option value="image">Image</option>
<option value="audio">{{ translate("SEARCH.AUDIO") }}</option>
<option value="image">{{ translate("SEARCH.IMAGE") }}</option>
<option value="application/pdf">PDF</option>
<option value="text/plain">Text</option>
<option value="video">Video</option>
<option value="text/plain">{{ translate("SEARCH.TEXT") }}</option>
<option value="video">{{ translate("SEARCH.VIDEO") }}</option>
</select>
</div>
<div class="flex-item" style="margin: 10px;">
<button id='submit-search' class="btn btn-success" @click="search()">Search</button>
<button id='submit-search' class="btn btn-success" @click="search()">{{ translate("SEARCH.SEARCH") }}</button>
</div>
</div>
</div>

<div>
<h3>Results: {{ matches.length }}</h3>
<h3>{{ translate("SEARCH.RESULTS") }}: {{ matches.length }}</h3>
<div v-if="showCancel" style="margin: 10px;">
<button class="btn btn-danger" @click="stopSearch()">Cancel Search</button>
</div>
<div v-if="matches!=0" class="table-responsive">
<table class="table">
<thead>
<tr v-if="matches!=0" style="cursor:pointer;">
<th @click="setSortBy('name')">Name <span v-if="sortBy=='name'" v-bind:class="['fas', normalSortOrder ? 'fa-angle-down' : 'fa-angle-up']"/></th>
<th @click="setSortBy('path')">Directory <span v-if="sortBy=='path'" v-bind:class="['fas', normalSortOrder ? 'fa-angle-down' : 'fa-angle-up']"/></th>
<th @click="setSortBy('size')">Size <span v-if="sortBy=='size'" v-bind:class="['fas', normalSortOrder ? 'fa-angle-down' : 'fa-angle-up']"/></th>
<th @click="setSortBy('modified')">Modified <span v-if="sortBy=='modified'" v-bind:class="['fas', normalSortOrder ? 'fa-angle-down' : 'fa-angle-up']"/></th>
<th @click="setSortBy('created')">Created <span v-if="sortBy=='created'" v-bind:class="['fas', normalSortOrder ? 'fa-angle-down' : 'fa-angle-up']"/></th>
<th @click="setSortBy('name')">{{ translate("DRIVE.NAME") }}<span v-if="sortBy=='name'" v-bind:class="['fas', normalSortOrder ? 'fa-angle-down' : 'fa-angle-up']"/></th>
<th @click="setSortBy('path')">{{ translate("SEARCH.DIR") }}<span v-if="sortBy=='path'" v-bind:class="['fas', normalSortOrder ? 'fa-angle-down' : 'fa-angle-up']"/></th>
<th @click="setSortBy('size')">{{ translate("DRIVE.SIZE") }}<span v-if="sortBy=='size'" v-bind:class="['fas', normalSortOrder ? 'fa-angle-down' : 'fa-angle-up']"/></th>
<th @click="setSortBy('modified')">{{ translate("DRIVE.MODIFIED") }} <span v-if="sortBy=='modified'" v-bind:class="['fas', normalSortOrder ? 'fa-angle-down' : 'fa-angle-up']"/></th>
<th @click="setSortBy('created')">{{ translate("DRIVE.CREATED") }}<span v-if="sortBy=='created'" v-bind:class="['fas', normalSortOrder ? 'fa-angle-down' : 'fa-angle-up']"/></th>

</tr>
</thead>
Expand Down Expand Up @@ -103,11 +103,13 @@

<script>
const Spinner = require("./spinner/Spinner.vue");
const i18n = require("../i18n/index.js");

module.exports = {
components: {
Spinner
},
mixins:[i18n],
data: function() {
return {
searchContains: "",
Expand Down
46 changes: 23 additions & 23 deletions src/components/Signup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@
name="username"
v-model="username"
ref="username"
placeholder="Public username"
:placeholder="translate('SIGNUP.USERNAME')"
@input="(val) => (username = username.toLowerCase())"
/>

<AppButton class="generate-password" type="primary" block accent @click.native="generatePassword()">
Generate password
{{ translate("SIGNUP.GENERATE") }}
</AppButton>

<FormPassword v-model="password" :passwordIsVisible="showPasswords" placeholder="Click generate password" firstOfTwo />
<FormPassword v-model="password" :passwordIsVisible="showPasswords" :placeholder="translate('SIGNUP.CLICKGEN')" firstOfTwo />

<FormPassword v-model="password2" :passwordIsVisible="showPasswords" placeholder="Re-enter password" @keyup.native.enter="signup()"/>
<FormPassword v-model="password2" :passwordIsVisible="showPasswords" :placeholder="translate('SIGNUP.REENTER')" @keyup.native.enter="signup()"/>

<label class="checkbox__group">
I understand that passwords cannot be reset or recovered - if I forget my password, then I will lose access to my
account and data. If I enter my password into a malicious website then I will lose control of my account.
{{ translate("SIGNUP.AGREE") }}
<input
type="checkbox"
name="safePassword"
Expand All @@ -31,7 +30,7 @@
</label>

<label class="checkbox__group">
I accept the <a href="/terms.html" target="_blank" rel="noopener noreferrer">Terms of Service</a> and <a href="/privacy.html" target="_blank" rel="noopener noreferrer">Privacy Policy</a>
{{ translate("SIGNUP.ACCEPT") }} <a href="/terms.html" target="_blank" rel="noopener noreferrer">{{ translate("SIGNUP.TERMS") }}</a> {{ translate("SIGNUP.AND") }} <a href="/privacy.html" target="_blank" rel="noopener noreferrer">{{ translate("SIGNUP.POLICY") }}</a>
<input
type="checkbox"
name="tosAccepted"
Expand All @@ -50,42 +49,42 @@
<div class="card__meta options">
<h3>Pro Account</h3>
<ul>
<li>100 GB of hyper secure storage</li>
<li>All our bundled private applications</li>
<li>&#x00A3;5 / month</li>
<li>100 GB {{ translate("SIGNUP.HYPER") }}</li>
<li>{{ translate("SIGNUP.BUNDLED") }}</li>
<li>&#x00A3;5 / {{ translate("SIGNUP.MONTH") }}</li>
</ul>
<AppButton @click.native="setPlan(100000000000)" type="primary" block accent>Select Pro</AppButton>
</div>
<div class="card__meta options">
<h3>Visionary Account</h3>
<ul>
<li>500 GB of hyper secure storage</li>
<li>All our bundled private applications</li>
<li>&#x00A3;10 / month</li>
<li>500 GB {{ translate("SIGNUP.HYPER") }}</li>
<li>{{ translate("SIGNUP.BUNDLED") }}</li>
<li>&#x00A3;10 / {{ translate("SIGNUP.MONTH") }}</li>
</ul>
<AppButton @click.native="setPlan(500000000000)" type="primary" block accent>Select Visionary</AppButton>
</div>
<div class="card__meta options">
<h3>Pioneer Account</h3>
<ul>
<li>2000 GB of hyper secure storage</li>
<li>All our bundled private applications</li>
<li>&#x00A3;25 / month</li>
<li>2000 GB {{ translate("SIGNUP.HYPER") }}</li>
<li>{{ translate("SIGNUP.BUNDLED") }}</li>
<li>&#x00A3;25 / {{ translate("SIGNUP.MONTH") }}</li>
</ul>
<AppButton @click.native="setPlan(2000000000000)" type="primary" block accent>Select Pioneer</AppButton>
</div>
<div class="card__meta options">
<h3>Trailblazer Account</h3>
<ul>
<li>4000 GB of hyper secure storage</li>
<li>All our bundled private applications</li>
<li>&#x00A3;40 / month</li>
<li>4000 GB {{ translate("SIGNUP.HYPER") }}</li>
<li>{{ translate("SIGNUP.BUNDLED") }}</li>
<li>&#x00A3;40 / {{ translate("SIGNUP.MONTH") }}</li>
</ul>
<AppButton @click.native="setPlan(4000000000000)" type="primary" block accent>Select Trailblazer</AppButton>
</div>
<div class="card__meta options">
<h3>Want to try it first?</h3>
<label>Try it for free on our <u><a href="https://peergos-demo.net/?signup=true" target="_blank">demo server</a></u>.
<h3>{{ translate("SIGNUP.TRYTITLE") }}</h3>
<label>{{ translate("SIGNUP.TRY") }} <u><a href="https://peergos-demo.net/?signup=true" target="_blank">demo server</a></u>.
</label>
</div>
</div>
Expand Down Expand Up @@ -127,6 +126,7 @@ const BannedUsernames = require('../mixins/password/bannedUsernames.json');
const FormPassword = require("./form/FormPassword.vue");
const UriDecoder = require('../mixins/uridecoder/index.js');
const sandboxMixin = require("../mixins/sandbox/index.js");
const i18n = require("../i18n/index.js");
const Continue = require("Continue.vue");
module.exports = {
components: {
Expand All @@ -135,7 +135,7 @@ module.exports = {
Continue,
},

mixins:[UriDecoder, sandboxMixin],
mixins:[UriDecoder, sandboxMixin, i18n],

props: {
token: {
Expand Down Expand Up @@ -170,7 +170,7 @@ module.exports = {
'network'
]),
signupButtonText() {
return this.desiredQuota > 0 ? "Add payment card and sign up" : "Sign up";
return this.desiredQuota > 0 ? this.translate("SIGNUP.SIGNUPPAID") : this.translate("SIGNUP.SIGNUPFREE");
},
},
mounted() {
Expand Down
Loading
Loading