Skip to content

Commit ae146d4

Browse files
budak7273knightzac19lmachensjoshuatajonbloom
authored
Update main with changes from staging (#236)
* feat: add more languages, fix DE flag discoloration, sml-versions redirect (#200) * fix: language flag icons showing with incorrect colors (ex. germany white instead of black) * feat: add es, hu, ko, pt-BR, to language picker. widen dropdown, setup overflow scrolling * fix: typo * feat: redirect old /sml-versions page to /mod/SML * Add virustotal results to version screen (#192) * feat: added virustotal results to versions screen * fix: remove canedit from vt results * fix: update to virustotal_results * fix: move thead to tbody/make text translatable --------- Co-authored-by: Rob B <computerguy440+gh@gmail.com> * feat: add Satisfactory Interactive Map th.gl tool link (#211) * Add Satisfactory Interactive Maps by TH.GL * Contain images with different aspect ratio * Prettify * fix(auth): can't sign out (#209) Fixes #131. Explicitly setting the cookie hostname was causing cookie.remove to fail. Co-authored-by: Rob B <computerguy440+gh@gmail.com> * fix: migrate away from appshell (#210) * fix: migrate away from appshell fixes #208 * fix: prettier errors in base layout --------- Co-authored-by: Rob B <computerguy440+gh@gmail.com> * fix: building devcontainer from windows host failing on translations (#215) https://stackoverflow.com/questions/41219148/shell-strange-string-concatenation-behavior * fix: some translations still displaying english data (#216) * feat: admin page to view and edit announcements (#218) - add titles to admin edit pages - add headers to admin edit page input boxes * Update api-docs/+page.svelte to reference proper API (#227) GraphQL -> REST API * feat: add satisfactory-architect.com tool link (#228) * Add language picker to mobile sidebar (#234) * fix: Added button when using the side menu at the top * Bun run formatting fix --------- Co-authored-by: Rob B <computerguy440+gh@gmail.com> --------- Co-authored-by: Zachary Knight <knightzac19@users.noreply.github.com> Co-authored-by: DevLeon <leon@machens.koeln> Co-authored-by: Josh Asplund <joshasplund@gmail.com> Co-authored-by: Jon Bloom <github@jon.tw> Co-authored-by: ArthurHeitmann <37270165+ArthurHeitmann@users.noreply.github.com> Co-authored-by: rhit-mooretj <112582846+rhit-mooretj@users.noreply.github.com>
1 parent 230252e commit ae146d4

File tree

22 files changed

+332
-56
lines changed

22 files changed

+332
-56
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
# from the other because of the line ending (\r vs \r\n)
44
* text=auto
55
*.sh text eol=lf
6+
*.env* text eol=lf

.github/workflows/push-base.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ on:
77
required: true
88
type: string
99

10+
# cspell:ignore snok rlespinasse
11+
1012
jobs:
1113
build:
1214
name: Build

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ To define new translation keys yourself, contact us on the Discord about getting
132132

133133
See these documentation pages about how to use Tolgee in code:
134134

135-
- [Using `$t()` and the `T` component](https://tolgee.io/js-sdk/integrations/svelte/translating)
136-
- [Full spec for `$t()`](https://tolgee.io/js-sdk/api/core_package/tolgee#t)
137-
- [ICU Message Format](https://tolgee.io/platform/translation_process/icu_message_format)
135+
* [Using `$t()` and the `T` component](https://tolgee.io/js-sdk/integrations/svelte/translating)
136+
* [Full spec for `$t()`](https://tolgee.io/js-sdk/api/core_package/tolgee#t)
137+
* [ICU Message Format](https://tolgee.io/platform/translation_process/icu_message_format)
138138

139139
### Downloading Translations
140140

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
// words - list of words to be always considered correct
88
"words": [
99
"cfworker",
10+
"chainer",
1011
"Deantendo",
1112
"felte",
1213
"fenv",

download_translations.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ display_error() {
55
exit 1
66
}
77

8-
if [[ -z "${PUBLIC_TOLGEE_API_URL}" ]]; then
8+
if [ -z "${PUBLIC_TOLGEE_API_URL}" ]; then
99
display_error "PUBLIC_TOLGEE_API_URL"
1010
else
11-
echo "Using PUBLIC_TOLGEE_API_URL of $PUBLIC_TOLGEE_API_URL"
11+
echo "Using PUBLIC_TOLGEE_API_URL of ${PUBLIC_TOLGEE_API_URL}"
1212
fi
1313

14-
if [[ -z "${PUBLIC_TOLGEE_API_KEY}" ]]; then
14+
if [ -z "${PUBLIC_TOLGEE_API_KEY}" ]; then
1515
display_error "PUBLIC_TOLGEE_API_KEY"
1616
else
17-
echo "Using PUBLIC_TOLGEE_API_KEY of $PUBLIC_TOLGEE_API_KEY"
17+
echo "Using PUBLIC_TOLGEE_API_KEY of ${PUBLIC_TOLGEE_API_KEY}"
1818
fi
1919

20-
curl "$PUBLIC_TOLGEE_API_URL/v2/projects/export" -H "X-API-Key: $PUBLIC_TOLGEE_API_KEY" --output translations.zip
20+
CURL_URL="${PUBLIC_TOLGEE_API_URL}/v2/projects/export"
2121

22-
if ! curl "$PUBLIC_TOLGEE_API_URL/v2/projects/export" -H "X-API-Key: $PUBLIC_TOLGEE_API_KEY" --output translations.zip; then
22+
if ! curl $CURL_URL -H "X-API-Key: ${PUBLIC_TOLGEE_API_KEY}" --output translations.zip; then
2323
echo "Failed to download translation zip file? Tried using URL:"
24-
echo "$PUBLIC_TOLGEE_API_URL/v2/projects/export"
24+
echo $CURL_URL
2525
exit 1
2626
fi
2727

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
mutation CreateAnnouncement($announcement: NewAnnouncement!) {
2+
createAnnouncement(announcement: $announcement) {
3+
id
4+
message
5+
importance
6+
}
7+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
mutation DeleteAnnouncement($id: AnnouncementID!) {
2+
deleteAnnouncement(announcementId: $id)
3+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
mutation UpdateAnnouncement($id: AnnouncementID!, $announcement: UpdateAnnouncement!) {
2+
updateAnnouncement(announcementId: $id, announcement: $announcement) {
3+
id
4+
message
5+
importance
6+
}
7+
}

src/lib/components/auth/LoginDialog.svelte

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,10 @@
2424
2525
if (browser) {
2626
let first = true;
27+
2728
userToken.subscribe((token) => {
28-
if (token) {
29-
const oneMonth = new Date(new Date().getTime() + 30 * 24 * 60 * 60 * 1000);
30-
cookie.set('token', token, {
31-
domain: window.location.hostname,
32-
expires: oneMonth
33-
});
34-
} else if (!first) {
29+
if (!token && !first) {
30+
// User is logged in but token has been set to null (logging out)
3531
client
3632
.mutation(LogoutDocument, undefined, {
3733
requestPolicy: 'network-only'
@@ -41,23 +37,23 @@
4137
.then(() => {
4238
cookie.remove('token');
4339
});
44-
}
45-
46-
first = false;
47-
48-
if (token) {
40+
$user = null;
41+
} else if (token) {
42+
const oneMonth = new Date(new Date().getTime() + 30 * 24 * 60 * 60 * 1000);
43+
cookie.set('token', token, {
44+
expires: oneMonth
45+
});
46+
first = false;
4947
client
5048
.query(GetMeDocument, {}, { requestPolicy: 'network-only' })
5149
.toPromise()
5250
.then((response) => {
5351
if (response.error) {
5452
console.error(response.error.message);
5553
} else if (response.data) {
56-
user.set(response.data.getMe);
54+
$user = response.data.getMe;
5755
}
5856
});
59-
} else {
60-
user.set(null);
6157
}
6258
});
6359
}
@@ -116,7 +112,7 @@
116112
autohide: false
117113
});
118114
} else {
119-
userToken.set(result.data.session.token);
115+
$userToken = result.data.session.token;
120116
modalStore.close();
121117
}
122118
})

src/lib/components/general/Sidebar.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import { base } from '$app/paths';
55
import { user, userToken } from '$lib/stores/user';
66
import { getTranslate } from '@tolgee/svelte';
7+
import TranslationDropdown from '$lib/components/general/TranslationDropdown.svelte';
78
import LoginModal from '$lib/modals/LoginModal.svelte';
89
import type { SidebarItemData } from '$lib/utils/sidebarItemData';
910
import SidebarItem from './SidebarItem.svelte';
@@ -96,6 +97,10 @@
9697
const drawerStore = getDrawerStore();
9798
</script>
9899

100+
<li class="flex flex-row items-center justify-center gap-4 px-3 pt-2 xl:hidden">
101+
<TranslationDropdown />
102+
</li>
103+
99104
<div class="flex h-full max-w-xl flex-col justify-between overflow-y-auto p-4">
100105
<div class="flex h-full max-w-xl flex-col gap-4">
101106
<nav class="list-nav xl:hidden">

0 commit comments

Comments
 (0)