chore: prepare local web and Android release 3.3.1-local.2
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import 'dart:ui';
|
||||
|
||||
const defaultAppLocale = Locale('ru');
|
||||
|
||||
const Map<String, Locale> locales = {
|
||||
// Default locale
|
||||
// Fallback locale for missing translations
|
||||
'English (en)': Locale('en'),
|
||||
// Additional locales
|
||||
'Arabic (ar)': Locale('ar'),
|
||||
|
||||
@@ -309,6 +309,7 @@ class MainWidget extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return EasyLocalization(
|
||||
supportedLocales: locales.values.toList(),
|
||||
startLocale: defaultAppLocale,
|
||||
path: translationsPath,
|
||||
useFallbackTranslations: true,
|
||||
fallbackLocale: locales.values.first,
|
||||
|
||||
@@ -41,6 +41,7 @@ class BootstrapErrorWidget extends StatelessWidget {
|
||||
|
||||
return EasyLocalization(
|
||||
supportedLocales: locales.values.toList(),
|
||||
startLocale: defaultAppLocale,
|
||||
path: translationsPath,
|
||||
useFallbackTranslations: true,
|
||||
fallbackLocale: locales.values.first,
|
||||
|
||||
@@ -12,6 +12,7 @@ Future<bool> loadTranslations() async {
|
||||
|
||||
final controller = EasyLocalizationController(
|
||||
supportedLocales: locales.values.toList(),
|
||||
startLocale: defaultAppLocale,
|
||||
useFallbackTranslations: true,
|
||||
saveLocale: true,
|
||||
assetLoader: const CodegenLoader(),
|
||||
|
||||
@@ -2,6 +2,8 @@ import 'package:immich_mobile/domain/models/store.model.dart';
|
||||
import 'package:immich_mobile/entities/store.entity.dart';
|
||||
import 'package:punycode/punycode.dart';
|
||||
|
||||
const defaultServerUrl = 'https://immich.kusoft.xyz';
|
||||
|
||||
/// Normalizes a server URL, guaranteeing that it has a schema and no trailing slashes
|
||||
String normalizeServerUrl(String url) {
|
||||
final trimmedUrl = url.trim();
|
||||
|
||||
@@ -164,9 +164,7 @@ class LoginForm extends HookConsumerWidget {
|
||||
|
||||
useEffect(() {
|
||||
final serverUrl = getServerUrl();
|
||||
if (serverUrl != null) {
|
||||
serverEndpointController.text = serverUrl;
|
||||
}
|
||||
serverEndpointController.text = serverUrl ?? defaultServerUrl;
|
||||
return null;
|
||||
}, []);
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ name: immich_mobile
|
||||
description: Immich - selfhosted backup media file on mobile phone
|
||||
|
||||
publish_to: 'none'
|
||||
version: 3.3.1+3030199
|
||||
version: 3.3.1-local.2+3030200
|
||||
|
||||
environment:
|
||||
sdk: '>=3.12.0 <4.0.0'
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
<!doctype html>
|
||||
<html class="dark">
|
||||
<head>
|
||||
<script id="immich-ru-default">
|
||||
try {
|
||||
if (!localStorage.getItem('lang')) {
|
||||
localStorage.setItem('lang', 'ru');
|
||||
}
|
||||
if (!localStorage.getItem('locale')) {
|
||||
localStorage.setItem('locale', 'ru-RU');
|
||||
}
|
||||
document.documentElement.lang = localStorage.getItem('lang') || 'ru';
|
||||
} catch {
|
||||
// noop
|
||||
}
|
||||
</script>
|
||||
<!-- (used for SSR) -->
|
||||
<!-- metadata:tags -->
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { render, screen } from '@testing-library/svelte';
|
||||
import { fireEvent, render, screen } from '@testing-library/svelte';
|
||||
import { vi } from 'vitest';
|
||||
import SideBarSection from '$lib/components/sidebar/Sidebar.svelte';
|
||||
import { sidebarStore } from '$lib/stores/sidebar.svelte';
|
||||
@@ -77,4 +77,31 @@ describe('Sidebar component', () => {
|
||||
// then
|
||||
expect(sidebarStore.reset).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it.each`
|
||||
isFullSidebar | isSidebarOpen | shouldBubble
|
||||
${false} | ${false} | ${true}
|
||||
${false} | ${true} | ${false}
|
||||
${true} | ${false} | ${true}
|
||||
${true} | ${true} | ${true}
|
||||
`(
|
||||
'Escape bubbles=$shouldBubble when isFullSidebar=$isFullSidebar and isSidebarOpen=$isSidebarOpen',
|
||||
async ({ isFullSidebar, isSidebarOpen, shouldBubble }) => {
|
||||
mocks.mediaQueryManager.isFullSidebar = isFullSidebar;
|
||||
sidebarStore.isOpen = isSidebarOpen;
|
||||
render(SideBarSection);
|
||||
vi.mocked(sidebarStore.reset).mockClear();
|
||||
|
||||
const onDocumentKeydown = vi.fn();
|
||||
document.addEventListener('keydown', onDocumentKeydown);
|
||||
try {
|
||||
await fireEvent.keyDown(screen.getByTestId('sidebar-parent'), { key: 'Escape', code: 'Escape' });
|
||||
|
||||
expect(onDocumentKeydown).toHaveBeenCalledTimes(shouldBubble ? 1 : 0);
|
||||
expect(sidebarStore.reset).toHaveBeenCalledTimes(shouldBubble ? 0 : 1);
|
||||
} finally {
|
||||
document.removeEventListener('keydown', onDocumentKeydown);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user