feat: add fast built-in interface languages
This commit is contained in:
parent
5e1bebdbd5
commit
9ca908e88d
|
|
@ -2245,7 +2245,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "pdf-presenter"
|
||||
version = "0.1.91"
|
||||
version = "0.1.92"
|
||||
dependencies = [
|
||||
"bytemuck",
|
||||
"chrono",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ default-members = ["crates/pdf-presenter"]
|
|||
resolver = "3"
|
||||
|
||||
[workspace.package]
|
||||
version = "0.1.91"
|
||||
version = "0.1.92"
|
||||
edition = "2024"
|
||||
license = "MIT"
|
||||
repository = "https://proxy.dandaedre.com/gitea/idle-org/pdf-presenter"
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ slow document operation does not have to freeze navigation.
|
|||
| **Notes that belong to the presentation** | Read notes from a sidecar or the PDF, import TXT/Markdown, and double-click the notes pane to edit the current slide. Notes automatically fit the available space. |
|
||||
| **Presentation-aware desktop behavior** | PDF Presenter asks supported operating systems to keep the display awake and reports whether protection is active. Closing Presenter also closes its Slides windows. |
|
||||
| **Portable by design** | The release binaries include the PDF renderer and application dependencies. Keep the extracted folder anywhere convenient; no Rust or separate PDF software is required. |
|
||||
| **Themes and languages** | Choose from 20 built-in palettes and English, French, Spanish, Japanese, Simplified Chinese, German or Brazilian Portuguese. System language detection stays offline. |
|
||||
|
||||
On Windows, multi-screen output, per-screen layouts, zoom, tools, and unplugging then
|
||||
reconnecting displays have been tested in extended use. Linux and macOS use the same
|
||||
|
|
|
|||
|
|
@ -4,6 +4,11 @@ the presence of a package here does not mean it is linked on every OS.
|
|||
Unmodified source packages are available at https://crates.io.
|
||||
For alternative licenses, permissive MIT/Apache alternatives are selected.
|
||||
|
||||
Noto Sans CJK 2.004
|
||||
License expression: OFL-1.1
|
||||
Source: https://github.com/notofonts/noto-cjk/releases/tag/Sans2.004
|
||||
assets/fonts/OFL.txt: text 5c0af63904410dcf
|
||||
|
||||
ab_glyph 0.2.32
|
||||
License expression: Apache-2.0
|
||||
Source: https://github.com/alexheretic/ab-glyph
|
||||
|
|
@ -7121,6 +7126,106 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||
THE SOFTWARE.
|
||||
|
||||
|
||||
=== 5c0af63904410dcf ===
|
||||
Noto Sans: Copyright 2022 The Noto Project Authors (https://github.com/notofonts/latin-greek-cyrillic)
|
||||
Noto Sans CJK: Copyright 2014-2021 Adobe (http://www.adobe.com/).
|
||||
Noto Sans Devanagari: Copyright 2022 The Noto Project Authors (https://github.com/notofonts/devanagari)
|
||||
Noto Sans Thai: Copyright 2022 The Noto Project Authors (https://github.com/notofonts/thai)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License,
|
||||
Version 1.1.
|
||||
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font
|
||||
creation efforts of academic and linguistic communities, and to
|
||||
provide a free and open framework in which fonts may be shared and
|
||||
improved in partnership with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply to
|
||||
any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software
|
||||
components as distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to,
|
||||
deleting, or substituting -- in part or in whole -- any of the
|
||||
components of the Original Version, by changing formats or by porting
|
||||
the Font Software to a new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed,
|
||||
modify, redistribute, and sell modified and unmodified copies of the
|
||||
Font Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components, in
|
||||
Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the
|
||||
corresponding Copyright Holder. This restriction only applies to the
|
||||
primary font name as presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created using
|
||||
the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
|
||||
|
||||
=== 5cc390ab5e5e6507 ===
|
||||
MIT License
|
||||
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -0,0 +1,97 @@
|
|||
Noto Sans: Copyright 2022 The Noto Project Authors (https://github.com/notofonts/latin-greek-cyrillic)
|
||||
Noto Sans CJK: Copyright 2014-2021 Adobe (http://www.adobe.com/).
|
||||
Noto Sans Devanagari: Copyright 2022 The Noto Project Authors (https://github.com/notofonts/devanagari)
|
||||
Noto Sans Thai: Copyright 2022 The Noto Project Authors (https://github.com/notofonts/thai)
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License,
|
||||
Version 1.1.
|
||||
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font
|
||||
creation efforts of academic and linguistic communities, and to
|
||||
provide a free and open framework in which fonts may be shared and
|
||||
improved in partnership with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply to
|
||||
any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software
|
||||
components as distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to,
|
||||
deleting, or substituting -- in part or in whole -- any of the
|
||||
components of the Original Version, by changing formats or by porting
|
||||
the Font Software to a new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed,
|
||||
modify, redistribute, and sell modified and unmodified copies of the
|
||||
Font Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components, in
|
||||
Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the
|
||||
corresponding Copyright Holder. This restriction only applies to the
|
||||
primary font name as presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created using
|
||||
the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
# Embedded CJK font
|
||||
|
||||
`NotoSansCJK-Regular.ttc` is the unmodified Noto Sans CJK 2.004 collection used by
|
||||
Canvas Pilot, under the included [SIL Open Font License 1.1](OFL.txt). Upstream:
|
||||
<https://github.com/notofonts/noto-cjk/releases/tag/Sans2.004>.
|
||||
|
||||
SHA-256: `b76b0433203017ca80401b2ee0dd69350349871c4b19d504c34dbdd80541690a`.
|
||||
|
||||
PDF Presenter uses collection index 0 for Japanese and index 2 for Simplified
|
||||
Chinese. The collection is embedded in the executable; no runtime font lookup or
|
||||
download occurs. Font definitions are installed only when a CJK interface language
|
||||
is active and only when the language selection changes. Other interface languages
|
||||
retain egui's existing embedded fonts.
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
//! Interface catalog; diagnostic messages from workers remain in their original language.
|
||||
//! Allocation-free interface catalogs; worker diagnostics remain in their original language.
|
||||
use serde::{Deserialize, Serialize};
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
|
|
@ -7,37 +7,179 @@ pub enum Language {
|
|||
System,
|
||||
En,
|
||||
Fr,
|
||||
Es,
|
||||
Ja,
|
||||
ZhCn,
|
||||
De,
|
||||
PtBr,
|
||||
}
|
||||
impl Language {
|
||||
pub const ALL: [Self; 3] = [Self::System, Self::En, Self::Fr];
|
||||
pub const ALL: [Self; 8] = [
|
||||
Self::System,
|
||||
Self::En,
|
||||
Self::Fr,
|
||||
Self::Es,
|
||||
Self::Ja,
|
||||
Self::ZhCn,
|
||||
Self::De,
|
||||
Self::PtBr,
|
||||
];
|
||||
pub fn name(self) -> &'static str {
|
||||
match self {
|
||||
Self::System => "System / Système",
|
||||
Self::System => "System language",
|
||||
Self::En => "English",
|
||||
Self::Fr => "Français",
|
||||
Self::Es => "Español",
|
||||
Self::Ja => "Japanese",
|
||||
Self::ZhCn => "Chinese (Simplified)",
|
||||
Self::De => "Deutsch",
|
||||
Self::PtBr => "Português (Brasil)",
|
||||
}
|
||||
}
|
||||
pub fn french(self) -> bool {
|
||||
self.resolved() == ResolvedLanguage::Fr
|
||||
}
|
||||
fn resolved(self) -> ResolvedLanguage {
|
||||
match self {
|
||||
Self::Fr => true,
|
||||
Self::En => false,
|
||||
Self::System => system_french(),
|
||||
Self::System => system_language(),
|
||||
Self::En => ResolvedLanguage::En,
|
||||
Self::Fr => ResolvedLanguage::Fr,
|
||||
Self::Es => ResolvedLanguage::Es,
|
||||
Self::Ja => ResolvedLanguage::Ja,
|
||||
Self::ZhCn => ResolvedLanguage::ZhCn,
|
||||
Self::De => ResolvedLanguage::De,
|
||||
Self::PtBr => ResolvedLanguage::PtBr,
|
||||
}
|
||||
}
|
||||
}
|
||||
fn system_french() -> bool {
|
||||
static FRENCH: std::sync::OnceLock<bool> = std::sync::OnceLock::new();
|
||||
*FRENCH.get_or_init(|| {
|
||||
sys_locale::get_locale().is_some_and(|s| s.to_ascii_lowercase().starts_with("fr"))
|
||||
})
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
enum ResolvedLanguage {
|
||||
En,
|
||||
Fr,
|
||||
Es,
|
||||
Ja,
|
||||
ZhCn,
|
||||
De,
|
||||
PtBr,
|
||||
}
|
||||
pub fn apply(ctx: &egui::Context, language: &Language) {
|
||||
ctx.data_mut(|d| d.insert_temp(egui::Id::new("french"), language.french()));
|
||||
|
||||
fn language_id() -> egui::Id {
|
||||
egui::Id::new("pdf-presenter-language")
|
||||
}
|
||||
pub fn tr<'a>(ctx: &egui::Context, text: &'a str) -> &'a str {
|
||||
if !ctx.data(|d| d.get_temp::<bool>(egui::Id::new("french")).unwrap_or(false)) {
|
||||
return text;
|
||||
|
||||
fn resolve_system_locale(locale: Option<&str>) -> ResolvedLanguage {
|
||||
let locale = locale
|
||||
.unwrap_or("")
|
||||
.split('.')
|
||||
.next()
|
||||
.unwrap_or("")
|
||||
.replace('_', "-")
|
||||
.to_ascii_lowercase();
|
||||
let parts: Vec<_> = locale.split('-').collect();
|
||||
match parts.first().copied().unwrap_or("") {
|
||||
"fr" => ResolvedLanguage::Fr,
|
||||
"es" => ResolvedLanguage::Es,
|
||||
"ja" => ResolvedLanguage::Ja,
|
||||
"de" => ResolvedLanguage::De,
|
||||
"pt" if parts.contains(&"br") => ResolvedLanguage::PtBr,
|
||||
// Do not silently substitute Simplified Chinese for Traditional Chinese.
|
||||
"zh" if !parts
|
||||
.iter()
|
||||
.any(|part| matches!(*part, "hant" | "tw" | "hk" | "mo")) =>
|
||||
{
|
||||
ResolvedLanguage::ZhCn
|
||||
}
|
||||
_ => ResolvedLanguage::En,
|
||||
}
|
||||
}
|
||||
|
||||
fn system_language() -> ResolvedLanguage {
|
||||
static LANGUAGE: std::sync::OnceLock<ResolvedLanguage> = std::sync::OnceLock::new();
|
||||
*LANGUAGE.get_or_init(|| resolve_system_locale(sys_locale::get_locale().as_deref()))
|
||||
}
|
||||
|
||||
pub fn apply(ctx: &egui::Context, language: &Language) {
|
||||
let resolved = language.resolved();
|
||||
let previous = ctx.data(|data| data.get_temp::<ResolvedLanguage>(language_id()));
|
||||
if previous == Some(resolved) {
|
||||
return;
|
||||
}
|
||||
if matches!(resolved, ResolvedLanguage::Ja | ResolvedLanguage::ZhCn) {
|
||||
ctx.set_fonts(cjk_fonts(resolved));
|
||||
} else if previous
|
||||
.is_some_and(|language| matches!(language, ResolvedLanguage::Ja | ResolvedLanguage::ZhCn))
|
||||
{
|
||||
ctx.set_fonts(egui::FontDefinitions::default());
|
||||
}
|
||||
ctx.data_mut(|data| data.insert_temp(language_id(), resolved));
|
||||
}
|
||||
|
||||
fn cjk_fonts(language: ResolvedLanguage) -> egui::FontDefinitions {
|
||||
use egui::{FontData, FontFamily};
|
||||
let mut fonts = egui::FontDefinitions::default();
|
||||
let mut data = FontData::from_static(include_bytes!("../assets/fonts/NotoSansCJK-Regular.ttc"));
|
||||
data.index = if language == ResolvedLanguage::ZhCn {
|
||||
2
|
||||
} else {
|
||||
0
|
||||
};
|
||||
fonts.font_data.insert("noto-cjk".into(), data.into());
|
||||
for family in [FontFamily::Proportional, FontFamily::Monospace] {
|
||||
fonts
|
||||
.families
|
||||
.get_mut(&family)
|
||||
.expect("default font family")
|
||||
.insert(0, "noto-cjk".into());
|
||||
}
|
||||
fonts
|
||||
}
|
||||
|
||||
pub fn tr<'a>(ctx: &egui::Context, text: &'a str) -> &'a str {
|
||||
match ctx
|
||||
.data(|data| data.get_temp::<ResolvedLanguage>(language_id()))
|
||||
.unwrap_or(ResolvedLanguage::En)
|
||||
{
|
||||
ResolvedLanguage::En => text,
|
||||
ResolvedLanguage::Fr => fr(text),
|
||||
ResolvedLanguage::Es => es(text),
|
||||
ResolvedLanguage::Ja => ja(text),
|
||||
ResolvedLanguage::ZhCn => zh_cn(text),
|
||||
ResolvedLanguage::De => de(text),
|
||||
ResolvedLanguage::PtBr => pt_br(text),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn display_revert_countdown(ctx: &egui::Context, seconds: u64) -> String {
|
||||
match ctx
|
||||
.data(|data| data.get_temp::<ResolvedLanguage>(language_id()))
|
||||
.unwrap_or(ResolvedLanguage::En)
|
||||
{
|
||||
ResolvedLanguage::Fr => {
|
||||
format!("Retour automatique dans {seconds} s. Échap pour annuler.")
|
||||
}
|
||||
ResolvedLanguage::Es => {
|
||||
format!("Se revertirá automáticamente en {seconds} s. Escape para revertir.")
|
||||
}
|
||||
ResolvedLanguage::Ja => {
|
||||
format!("{seconds}秒後に自動的に元に戻ります。Escapeキーで戻します。")
|
||||
}
|
||||
ResolvedLanguage::ZhCn => {
|
||||
format!("将在 {seconds} 秒后自动还原。按 Escape 立即还原。")
|
||||
}
|
||||
ResolvedLanguage::De => {
|
||||
format!("Automatische Rückkehr in {seconds} s. Escape zum Zurücksetzen.")
|
||||
}
|
||||
ResolvedLanguage::PtBr => {
|
||||
format!("Reversão automática em {seconds} s. Escape para reverter.")
|
||||
}
|
||||
ResolvedLanguage::En => {
|
||||
format!("Automatically reverts in {seconds} seconds. Escape to revert.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn fr(text: &str) -> &str {
|
||||
match text {
|
||||
"Disk cache" => "Cache disque",
|
||||
"Maximum total size (MiB)" => "Taille totale maximale (Mio)",
|
||||
|
|
@ -297,8 +439,563 @@ pub fn tr<'a>(ctx: &egui::Context, text: &'a str) -> &'a str {
|
|||
"Save or discard notes before closing the presentation." => {
|
||||
"Enregistrez ou abandonnez les notes avant de quitter la présentation."
|
||||
}
|
||||
"Swap displays…" => "Inverser les écrans…",
|
||||
"Go to slide" => "Aller à la diapositive",
|
||||
"Enter to show · Backspace to clear" => "Entrée : diffuser · Retour arrière : effacer",
|
||||
"Enter to show; Backspace to clear" => "Entrée : diffuser ; Retour arrière : effacer",
|
||||
"Keep these display settings?" => "Conserver ces réglages d’écran ?",
|
||||
"Confirm once on any screen to apply to all displays." => {
|
||||
"Une seule confirmation sur un écran suffit pour appliquer à tous."
|
||||
}
|
||||
"Keep changes" => "Conserver",
|
||||
"Revert now" => "Rétablir maintenant",
|
||||
"Edit layout for" => "Modifier la disposition de",
|
||||
"Layout and saves apply to this display. Timer behavior is shared." => {
|
||||
"La disposition et les sauvegardes s’appliquent à cet écran. Le fonctionnement du minuteur reste partagé."
|
||||
}
|
||||
"Apply changes" => "Appliquer les modifications",
|
||||
"Selected" => "Sélection",
|
||||
"Current" => "Actuelle",
|
||||
"Blank Slides image" => "Image des diapositives masquées",
|
||||
"Custom picture selected" => "Image personnalisée sélectionnée",
|
||||
"Solid black" => "Écran noir",
|
||||
"Choose picture…" => "Choisir une image…",
|
||||
"Use solid black" => "Utiliser un écran noir",
|
||||
"A copy is saved and fitted to all Slides screens against a black background." => {
|
||||
"Une copie est conservée et ajustée à tous les écrans de diapositives, sur fond noir."
|
||||
}
|
||||
"Default PDF application" => "Application PDF par défaut",
|
||||
"Register PDF Presenter and its icon for PDF files in your Windows account." => {
|
||||
"Enregistre PDF Presenter et son icône pour les fichiers PDF de votre compte Windows."
|
||||
}
|
||||
"Set as default PDF app…" => "Définir comme application PDF par défaut…",
|
||||
"Windows will open Default Apps; select PDF Presenter for .pdf to confirm." => {
|
||||
"Windows ouvrira Applications par défaut : sélectionnez PDF Presenter pour .pdf afin de confirmer."
|
||||
}
|
||||
"Processed slides" => "Diapositives préparées",
|
||||
"Theme" => "Thème",
|
||||
"Language" => "Langue",
|
||||
_ => text,
|
||||
}
|
||||
}
|
||||
|
||||
macro_rules! catalog {
|
||||
($text:expr; $($source:literal => $translated:literal),* $(,)?) => {
|
||||
match $text {
|
||||
$($source => $translated,)*
|
||||
_ => $text,
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
fn es(text: &str) -> &str {
|
||||
catalog!(text;
|
||||
"Cancel" => "Cancelar",
|
||||
"Close" => "Cerrar",
|
||||
"Retry" => "Reintentar",
|
||||
"Quit" => "Salir",
|
||||
"Theme" => "Tema",
|
||||
"Language" => "Idioma",
|
||||
"Appearance" => "Apariencia",
|
||||
"Preferences" => "Preferencias",
|
||||
"Preferences…" => "Preferencias…",
|
||||
"Quick settings" => "Ajustes rápidos",
|
||||
"Menu" => "Menú",
|
||||
"Displays" => "Pantallas",
|
||||
"All slides" => "Todas las diapositivas",
|
||||
"Layout" => "Diseño",
|
||||
"Layout…" => "Diseño…",
|
||||
"Presenter layout" => "Diseño del presentador",
|
||||
"Presenter" => "Presentador",
|
||||
"Slides" => "Diapositivas",
|
||||
"Single screen" => "Una sola pantalla",
|
||||
"Unused" => "Sin usar",
|
||||
"Previous" => "Anterior",
|
||||
"Current" => "Actual",
|
||||
"Next" => "Siguiente",
|
||||
"PREVIOUS" => "ANTERIOR",
|
||||
"CURRENT" => "ACTUAL",
|
||||
"NEXT" => "SIGUIENTE",
|
||||
"Previous slide" => "Diapositiva anterior",
|
||||
"Current slide" => "Diapositiva actual",
|
||||
"Next slide" => "Diapositiva siguiente",
|
||||
"No slide" => "Sin diapositiva",
|
||||
"End of slides" => "Fin de las diapositivas",
|
||||
"Notes" => "Notas",
|
||||
"No notes for this slide" => "No hay notas para esta diapositiva",
|
||||
"PRESENTER NOTES · AUTO-FIT" => "NOTAS DEL PRESENTADOR · AJUSTE AUTOMÁTICO",
|
||||
"Show slides" => "Mostrar diapositivas",
|
||||
"Blank slides" => "Ocultar diapositivas",
|
||||
"NO OUTPUT DISPLAYED" => "NO SE MUESTRA NINGUNA SALIDA",
|
||||
"PRESENTING" => "PRESENTANDO",
|
||||
"PREPARING OUTPUT" => "PREPARANDO LA SALIDA",
|
||||
"Open PDF…" => "Abrir PDF…",
|
||||
"Open picture folder…" => "Abrir carpeta de imágenes…",
|
||||
"Open a PDF or picture folder to browse slides." => "Abra un PDF o una carpeta de imágenes para explorar las diapositivas.",
|
||||
"File chooser already open" => "El selector de archivos ya está abierto",
|
||||
"Import notes…" => "Importar notas…",
|
||||
"Import notes" => "Importar notas",
|
||||
"Processing notes…" => "Procesando notas…",
|
||||
"Save notes" => "Guardar notas",
|
||||
"Edit notes" => "Editar notas",
|
||||
"Saving notes…" => "Guardando notas…",
|
||||
"Empty note" => "Nota vacía",
|
||||
"Import and save notes" => "Importar y guardar notas",
|
||||
"Discard changes and close" => "Descartar cambios y cerrar",
|
||||
"Reload (discard edits)" => "Recargar (descartar cambios)",
|
||||
"Tools" => "Herramientas",
|
||||
"Off" => "Desactivado",
|
||||
"Pointer" => "Puntero",
|
||||
"Arrow" => "Flecha",
|
||||
"Highlighter" => "Resaltador",
|
||||
"Color" => "Color",
|
||||
"Size" => "Tamaño",
|
||||
"Undo" => "Deshacer",
|
||||
"Clear" => "Borrar",
|
||||
"Balanced" => "Equilibrado",
|
||||
"Slide focus" => "Prioridad a la diapositiva",
|
||||
"Notes first" => "Prioridad a las notas",
|
||||
"Start with a preset" => "Comenzar con un diseño",
|
||||
"Slides and notes" => "Diapositivas y notas",
|
||||
"Relative size" => "Tamaño relativo",
|
||||
"Space (%)" => "Espacio (%)",
|
||||
"Text size" => "Tamaño del texto",
|
||||
"Header" => "Encabezado",
|
||||
"Header and footer" => "Encabezado y pie",
|
||||
"Keep header visible" => "Mantener visible el encabezado",
|
||||
"Keep footer visible" => "Mantener visible el pie",
|
||||
"Show both" => "Mostrar ambos",
|
||||
"Auto-hide header" => "Ocultar automáticamente el encabezado",
|
||||
"Auto-hide footer" => "Ocultar automáticamente el pie",
|
||||
"Elapsed time" => "Tiempo transcurrido",
|
||||
"Time · HH:MM" => "Hora · HH:MM",
|
||||
"Timers and progress" => "Temporizadores y progreso",
|
||||
"Slide progress bar" => "Barra de progreso",
|
||||
"Reset timer" => "Reiniciar temporizador",
|
||||
"Start timer" => "Iniciar temporizador",
|
||||
"Pause timer" => "Pausar temporizador",
|
||||
"Countdown" => "Cuenta atrás",
|
||||
"Duration" => "Duración",
|
||||
"Running" => "En marcha",
|
||||
"Stopped" => "Detenido",
|
||||
"Waiting for first action" => "Esperando la primera acción",
|
||||
"Time is up" => "Se acabó el tiempo",
|
||||
"Bar height" => "Altura de la barra",
|
||||
"Each screen has one role; repeat a role to mirror it." => "Cada pantalla tiene una función; repítala para duplicarla.",
|
||||
"Window mode" => "Modo de ventana",
|
||||
"Follow global" => "Seguir ajuste global",
|
||||
"Always fullscreen" => "Siempre a pantalla completa",
|
||||
"Always windowed" => "Siempre en ventana",
|
||||
"Swap groups" => "Intercambiar grupos",
|
||||
"Presenter fullscreen" => "Presentador a pantalla completa",
|
||||
"Slides fullscreen" => "Diapositivas a pantalla completa",
|
||||
"Apply and remember" => "Aplicar y recordar",
|
||||
"Use single-screen mode?" => "¿Usar el modo de una sola pantalla?",
|
||||
"Keep Presenter view" => "Mantener la vista Presentador",
|
||||
"Use single-screen mode" => "Usar el modo de una sola pantalla",
|
||||
"Exit fullscreen" => "Salir de pantalla completa",
|
||||
"Enter fullscreen" => "Entrar en pantalla completa",
|
||||
"Slide preview" => "Vista previa de la diapositiva",
|
||||
"Preview only — presentation unchanged" => "Solo vista previa — la presentación no cambia",
|
||||
"Show on screen" => "Mostrar en la pantalla",
|
||||
"Preview size" => "Tamaño de la vista previa",
|
||||
"Compact" => "Compacto",
|
||||
"Large" => "Grande",
|
||||
"Safe browsing" => "Exploración segura",
|
||||
"Live browsing" => "Exploración en directo",
|
||||
"Change on click" => "Cambiar al hacer clic",
|
||||
"Show selected" => "Mostrar selección",
|
||||
"Page background" => "Fondo de página",
|
||||
"Fit padding color" => "Color del margen",
|
||||
"Enable page zoom" => "Activar zoom de página",
|
||||
"Page zoom" => "Zoom de página",
|
||||
"Reset zoom" => "Restablecer zoom",
|
||||
"Disable zoom" => "Desactivar zoom",
|
||||
"Keep zoom enabled" => "Mantener zoom activado",
|
||||
"Memory and cache" => "Memoria y caché",
|
||||
"Disk cache" => "Caché de disco",
|
||||
"Storage and preparation" => "Almacenamiento y preparación",
|
||||
"Storage locations" => "Ubicaciones de almacenamiento",
|
||||
"Preparing slide…" => "Preparando diapositiva…",
|
||||
"Slide ready" => "Diapositiva lista",
|
||||
"Loading into memory…" => "Cargando en memoria…",
|
||||
"Could not load slide" => "No se pudo cargar la diapositiva",
|
||||
"Quit presentation?" => "¿Salir de la presentación?",
|
||||
"Quit presentation" => "Salir de la presentación",
|
||||
"This closes Presenter and all Slides windows." => "Esto cierra el Presentador y todas las ventanas de diapositivas.",
|
||||
"Swap displays…" => "Intercambiar pantallas…", "Go to slide" => "Ir a la diapositiva",
|
||||
"Enter to show · Backspace to clear" => "Intro: mostrar · Retroceso: borrar",
|
||||
"Enter to show; Backspace to clear" => "Intro: mostrar; Retroceso: borrar",
|
||||
"Keep these display settings?" => "¿Conservar estos ajustes de pantalla?",
|
||||
"Confirm once on any screen to apply to all displays." => "Confirme una vez en cualquier pantalla para aplicar a todas.",
|
||||
"Keep changes" => "Conservar cambios", "Revert now" => "Revertir ahora",
|
||||
"Edit layout for" => "Editar diseño de", "Apply changes" => "Aplicar cambios",
|
||||
"Selected" => "Seleccionada", "Blank Slides image" => "Imagen de diapositivas ocultas",
|
||||
"Custom picture selected" => "Imagen personalizada seleccionada", "Solid black" => "Negro sólido",
|
||||
"Choose picture…" => "Elegir imagen…", "Use solid black" => "Usar negro sólido",
|
||||
"Processed slides" => "Diapositivas procesadas"
|
||||
)
|
||||
}
|
||||
|
||||
fn ja(text: &str) -> &str {
|
||||
catalog!(text;
|
||||
"Cancel" => "キャンセル",
|
||||
"Close" => "閉じる",
|
||||
"Retry" => "再試行",
|
||||
"Quit" => "終了",
|
||||
"Theme" => "テーマ",
|
||||
"Language" => "言語",
|
||||
"Appearance" => "外観",
|
||||
"Preferences" => "設定",
|
||||
"Preferences…" => "設定…",
|
||||
"Quick settings" => "クイック設定",
|
||||
"Menu" => "メニュー",
|
||||
"Displays" => "ディスプレイ",
|
||||
"All slides" => "すべてのスライド",
|
||||
"Layout" => "レイアウト",
|
||||
"Layout…" => "レイアウト…",
|
||||
"Presenter layout" => "発表者レイアウト",
|
||||
"Presenter" => "発表者",
|
||||
"Slides" => "スライド",
|
||||
"Single screen" => "シングルスクリーン",
|
||||
"Unused" => "未使用",
|
||||
"Previous" => "前へ",
|
||||
"Current" => "現在",
|
||||
"Next" => "次へ",
|
||||
"PREVIOUS" => "前のスライド",
|
||||
"CURRENT" => "現在のスライド",
|
||||
"NEXT" => "次のスライド",
|
||||
"Previous slide" => "前のスライド",
|
||||
"Current slide" => "現在のスライド",
|
||||
"Next slide" => "次のスライド",
|
||||
"No slide" => "スライドなし",
|
||||
"End of slides" => "スライドの終わり",
|
||||
"Notes" => "ノート",
|
||||
"No notes for this slide" => "このスライドにはノートがありません",
|
||||
"PRESENTER NOTES · AUTO-FIT" => "発表者ノート · 自動調整",
|
||||
"Show slides" => "スライドを表示",
|
||||
"Blank slides" => "スライドを非表示",
|
||||
"NO OUTPUT DISPLAYED" => "出力は表示されていません",
|
||||
"PRESENTING" => "プレゼンテーション中",
|
||||
"PREPARING OUTPUT" => "出力を準備中",
|
||||
"Open PDF…" => "PDFを開く…",
|
||||
"Open picture folder…" => "画像フォルダーを開く…",
|
||||
"Open a PDF or picture folder to browse slides." => "PDFまたは画像フォルダーを開いてスライドを参照します。",
|
||||
"File chooser already open" => "ファイル選択画面はすでに開いています",
|
||||
"Import notes…" => "ノートをインポート…",
|
||||
"Import notes" => "ノートをインポート",
|
||||
"Processing notes…" => "ノートを処理中…",
|
||||
"Save notes" => "ノートを保存",
|
||||
"Edit notes" => "ノートを編集",
|
||||
"Saving notes…" => "ノートを保存中…",
|
||||
"Empty note" => "空のノート",
|
||||
"Import and save notes" => "ノートをインポートして保存",
|
||||
"Discard changes and close" => "変更を破棄して閉じる",
|
||||
"Reload (discard edits)" => "再読み込み(編集を破棄)",
|
||||
"Tools" => "ツール",
|
||||
"Off" => "オフ",
|
||||
"Pointer" => "ポインター",
|
||||
"Arrow" => "矢印",
|
||||
"Highlighter" => "蛍光ペン",
|
||||
"Color" => "色",
|
||||
"Size" => "サイズ",
|
||||
"Undo" => "元に戻す",
|
||||
"Clear" => "消去",
|
||||
"Balanced" => "バランス",
|
||||
"Slide focus" => "スライド優先",
|
||||
"Notes first" => "ノート優先",
|
||||
"Start with a preset" => "プリセットから開始",
|
||||
"Slides and notes" => "スライドとノート",
|
||||
"Relative size" => "相対サイズ",
|
||||
"Space (%)" => "領域(%)",
|
||||
"Text size" => "文字サイズ",
|
||||
"Header" => "ヘッダー",
|
||||
"Header and footer" => "ヘッダーとフッター",
|
||||
"Keep header visible" => "ヘッダーを常に表示",
|
||||
"Keep footer visible" => "フッターを常に表示",
|
||||
"Show both" => "両方を表示",
|
||||
"Auto-hide header" => "ヘッダーを自動的に隠す",
|
||||
"Auto-hide footer" => "フッターを自動的に隠す",
|
||||
"Elapsed time" => "経過時間",
|
||||
"Time · HH:MM" => "時刻 · HH:MM",
|
||||
"Timers and progress" => "タイマーと進行状況",
|
||||
"Slide progress bar" => "スライド進行バー",
|
||||
"Reset timer" => "タイマーをリセット",
|
||||
"Start timer" => "タイマーを開始",
|
||||
"Pause timer" => "タイマーを一時停止",
|
||||
"Countdown" => "カウントダウン",
|
||||
"Duration" => "時間",
|
||||
"Running" => "実行中",
|
||||
"Stopped" => "停止中",
|
||||
"Waiting for first action" => "最初の操作を待機中",
|
||||
"Time is up" => "時間です",
|
||||
"Bar height" => "バーの高さ",
|
||||
"Each screen has one role; repeat a role to mirror it." => "各画面に役割を割り当てます。同じ役割を選ぶとミラー表示します。",
|
||||
"Window mode" => "ウィンドウモード",
|
||||
"Follow global" => "全体設定に従う",
|
||||
"Always fullscreen" => "常に全画面",
|
||||
"Always windowed" => "常にウィンドウ表示",
|
||||
"Swap groups" => "グループを入れ替え",
|
||||
"Presenter fullscreen" => "発表者を全画面表示",
|
||||
"Slides fullscreen" => "スライドを全画面表示",
|
||||
"Apply and remember" => "適用して保存",
|
||||
"Use single-screen mode?" => "シングルスクリーンモードを使用しますか?",
|
||||
"Keep Presenter view" => "発表者ビューを維持",
|
||||
"Use single-screen mode" => "シングルスクリーンモードを使用",
|
||||
"Exit fullscreen" => "全画面表示を終了",
|
||||
"Enter fullscreen" => "全画面表示にする",
|
||||
"Slide preview" => "スライドプレビュー",
|
||||
"Preview only — presentation unchanged" => "プレビューのみ — プレゼンテーションは変更されません",
|
||||
"Show on screen" => "表示する画面",
|
||||
"Preview size" => "プレビューサイズ",
|
||||
"Compact" => "コンパクト",
|
||||
"Large" => "大きい",
|
||||
"Safe browsing" => "安全な閲覧",
|
||||
"Live browsing" => "ライブ閲覧",
|
||||
"Change on click" => "クリックで切り替え",
|
||||
"Show selected" => "選択したものを表示",
|
||||
"Page background" => "ページ背景",
|
||||
"Fit padding color" => "余白の色",
|
||||
"Enable page zoom" => "ページズームを有効化",
|
||||
"Page zoom" => "ページズーム",
|
||||
"Reset zoom" => "ズームをリセット",
|
||||
"Disable zoom" => "ズームを無効化",
|
||||
"Keep zoom enabled" => "ズームを有効のままにする",
|
||||
"Memory and cache" => "メモリとキャッシュ",
|
||||
"Disk cache" => "ディスクキャッシュ",
|
||||
"Storage and preparation" => "保存場所と準備",
|
||||
"Storage locations" => "保存場所",
|
||||
"Preparing slide…" => "スライドを準備中…",
|
||||
"Slide ready" => "スライドの準備完了",
|
||||
"Loading into memory…" => "メモリに読み込み中…",
|
||||
"Could not load slide" => "スライドを読み込めませんでした",
|
||||
"Quit presentation?" => "プレゼンテーションを終了しますか?",
|
||||
"Quit presentation" => "プレゼンテーションを終了",
|
||||
"This closes Presenter and all Slides windows." => "発表者画面とすべてのスライド画面を閉じます。",
|
||||
"Swap displays…" => "画面を入れ替え…", "Go to slide" => "スライドへ移動",
|
||||
"Enter to show · Backspace to clear" => "Enterで表示 · Backspaceで消去",
|
||||
"Enter to show; Backspace to clear" => "Enterで表示、Backspaceで消去",
|
||||
"Keep these display settings?" => "このディスプレイ設定を維持しますか?",
|
||||
"Confirm once on any screen to apply to all displays." => "いずれかの画面で一度確認すると、すべてに適用されます。",
|
||||
"Keep changes" => "変更を維持", "Revert now" => "今すぐ元に戻す",
|
||||
"Edit layout for" => "レイアウトの編集対象", "Apply changes" => "変更を適用",
|
||||
"Selected" => "選択", "Blank Slides image" => "スライド非表示時の画像",
|
||||
"Custom picture selected" => "カスタム画像を選択済み", "Solid black" => "黒一色",
|
||||
"Choose picture…" => "画像を選択…", "Use solid black" => "黒一色を使用",
|
||||
"Processed slides" => "処理済みスライド"
|
||||
)
|
||||
}
|
||||
|
||||
fn zh_cn(text: &str) -> &str {
|
||||
catalog!(text;
|
||||
"Cancel" => "取消", "Close" => "关闭", "Retry" => "重试", "Quit" => "退出",
|
||||
"Theme" => "主题", "Language" => "语言", "Appearance" => "外观",
|
||||
"Preferences" => "首选项", "Preferences…" => "首选项…", "Quick settings" => "快速设置",
|
||||
"Menu" => "菜单", "Displays" => "显示器", "All slides" => "所有幻灯片",
|
||||
"Layout" => "布局", "Layout…" => "布局…", "Presenter layout" => "演讲者布局",
|
||||
"Presenter" => "演讲者", "Slides" => "幻灯片", "Single screen" => "单屏模式", "Unused" => "未使用",
|
||||
"Previous" => "上一张", "Current" => "当前", "Next" => "下一张",
|
||||
"PREVIOUS" => "上一张", "CURRENT" => "当前", "NEXT" => "下一张",
|
||||
"Previous slide" => "上一张幻灯片", "Current slide" => "当前幻灯片", "Next slide" => "下一张幻灯片",
|
||||
"No slide" => "无幻灯片", "End of slides" => "幻灯片结束", "Notes" => "备注",
|
||||
"No notes for this slide" => "此幻灯片没有备注", "PRESENTER NOTES · AUTO-FIT" => "演讲者备注 · 自动适应",
|
||||
"Show slides" => "显示幻灯片", "Blank slides" => "隐藏幻灯片",
|
||||
"NO OUTPUT DISPLAYED" => "未显示输出", "PRESENTING" => "正在演示", "PREPARING OUTPUT" => "正在准备输出",
|
||||
"Open PDF…" => "打开 PDF…", "Open picture folder…" => "打开图片文件夹…",
|
||||
"Open a PDF or picture folder to browse slides." => "打开 PDF 或图片文件夹以浏览幻灯片。",
|
||||
"File chooser already open" => "文件选择器已打开", "Import notes…" => "导入备注…",
|
||||
"Import notes" => "导入备注", "Processing notes…" => "正在处理备注…", "Save notes" => "保存备注",
|
||||
"Edit notes" => "编辑备注", "Saving notes…" => "正在保存备注…", "Empty note" => "空备注",
|
||||
"Import and save notes" => "导入并保存备注", "Discard changes and close" => "放弃更改并关闭",
|
||||
"Reload (discard edits)" => "重新加载(放弃编辑)", "Tools" => "工具", "Off" => "关闭",
|
||||
"Pointer" => "指针", "Arrow" => "箭头", "Highlighter" => "荧光笔", "Color" => "颜色",
|
||||
"Size" => "大小", "Undo" => "撤销", "Clear" => "清除", "Balanced" => "均衡",
|
||||
"Slide focus" => "幻灯片优先", "Notes first" => "备注优先", "Start with a preset" => "从预设开始",
|
||||
"Slides and notes" => "幻灯片和备注", "Relative size" => "相对大小", "Space (%)" => "空间 (%)",
|
||||
"Text size" => "文字大小", "Header" => "页眉", "Header and footer" => "页眉和页脚",
|
||||
"Keep header visible" => "保持页眉可见", "Keep footer visible" => "保持页脚可见", "Show both" => "两者都显示",
|
||||
"Auto-hide header" => "自动隐藏页眉", "Auto-hide footer" => "自动隐藏页脚",
|
||||
"Elapsed time" => "已用时间", "Time · HH:MM" => "时间 · HH:MM", "Timers and progress" => "计时器和进度",
|
||||
"Slide progress bar" => "幻灯片进度条", "Reset timer" => "重置计时器", "Start timer" => "启动计时器",
|
||||
"Pause timer" => "暂停计时器", "Countdown" => "倒计时", "Duration" => "时长", "Running" => "运行中",
|
||||
"Stopped" => "已停止", "Waiting for first action" => "等待首次操作", "Time is up" => "时间到",
|
||||
"Bar height" => "进度条高度", "Each screen has one role; repeat a role to mirror it." => "每个屏幕分配一个角色;重复角色可进行镜像显示。",
|
||||
"Window mode" => "窗口模式", "Follow global" => "跟随全局设置", "Always fullscreen" => "始终全屏",
|
||||
"Always windowed" => "始终窗口化", "Swap groups" => "交换分组", "Presenter fullscreen" => "演讲者全屏",
|
||||
"Slides fullscreen" => "幻灯片全屏", "Apply and remember" => "应用并记住",
|
||||
"Use single-screen mode?" => "使用单屏模式?", "Keep Presenter view" => "保留演讲者视图",
|
||||
"Use single-screen mode" => "使用单屏模式", "Exit fullscreen" => "退出全屏", "Enter fullscreen" => "进入全屏",
|
||||
"Slide preview" => "幻灯片预览", "Preview only — presentation unchanged" => "仅预览 — 演示内容不变",
|
||||
"Show on screen" => "显示在屏幕", "Preview size" => "预览大小", "Compact" => "紧凑", "Large" => "大",
|
||||
"Safe browsing" => "安全浏览", "Live browsing" => "实时浏览", "Change on click" => "点击时切换",
|
||||
"Show selected" => "显示所选项", "Page background" => "页面背景", "Fit padding color" => "边距颜色",
|
||||
"Enable page zoom" => "启用页面缩放", "Page zoom" => "页面缩放", "Reset zoom" => "重置缩放",
|
||||
"Disable zoom" => "禁用缩放", "Keep zoom enabled" => "保持缩放启用", "Memory and cache" => "内存和缓存",
|
||||
"Disk cache" => "磁盘缓存", "Storage and preparation" => "存储和准备", "Storage locations" => "存储位置",
|
||||
"Preparing slide…" => "正在准备幻灯片…", "Slide ready" => "幻灯片已就绪", "Loading into memory…" => "正在加载到内存…",
|
||||
"Could not load slide" => "无法加载幻灯片", "Quit presentation?" => "退出演示?",
|
||||
"Quit presentation" => "退出演示", "This closes Presenter and all Slides windows." => "这将关闭演讲者窗口和所有幻灯片窗口。",
|
||||
"Swap displays…" => "交换显示器…", "Go to slide" => "转到幻灯片",
|
||||
"Enter to show · Backspace to clear" => "Enter 显示 · Backspace 清除",
|
||||
"Enter to show; Backspace to clear" => "Enter 显示;Backspace 清除",
|
||||
"Keep these display settings?" => "保留这些显示设置?",
|
||||
"Confirm once on any screen to apply to all displays." => "在任意屏幕确认一次即可应用到所有显示器。",
|
||||
"Keep changes" => "保留更改", "Revert now" => "立即还原", "Edit layout for" => "编辑布局:",
|
||||
"Apply changes" => "应用更改", "Selected" => "已选择", "Blank Slides image" => "隐藏幻灯片时的图片",
|
||||
"Custom picture selected" => "已选择自定义图片", "Solid black" => "纯黑",
|
||||
"Choose picture…" => "选择图片…", "Use solid black" => "使用纯黑", "Processed slides" => "已处理的幻灯片"
|
||||
)
|
||||
}
|
||||
|
||||
fn de(text: &str) -> &str {
|
||||
catalog!(text;
|
||||
"Cancel" => "Abbrechen", "Close" => "Schließen", "Retry" => "Erneut versuchen", "Quit" => "Beenden",
|
||||
"Theme" => "Design", "Language" => "Sprache", "Appearance" => "Darstellung",
|
||||
"Preferences" => "Einstellungen", "Preferences…" => "Einstellungen…", "Quick settings" => "Schnelleinstellungen",
|
||||
"Menu" => "Menü", "Displays" => "Bildschirme", "All slides" => "Alle Folien", "Layout" => "Layout",
|
||||
"Layout…" => "Layout…", "Presenter layout" => "Präsentatorlayout", "Presenter" => "Präsentator",
|
||||
"Slides" => "Folien", "Single screen" => "Einzelbildschirm", "Unused" => "Unbenutzt",
|
||||
"Previous" => "Zurück", "Current" => "Aktuell", "Next" => "Weiter", "PREVIOUS" => "VORHERIGE",
|
||||
"CURRENT" => "AKTUELL", "NEXT" => "NÄCHSTE", "Previous slide" => "Vorherige Folie",
|
||||
"Current slide" => "Aktuelle Folie", "Next slide" => "Nächste Folie", "No slide" => "Keine Folie",
|
||||
"End of slides" => "Ende der Folien", "Notes" => "Notizen", "No notes for this slide" => "Keine Notizen für diese Folie",
|
||||
"Show slides" => "Folien anzeigen", "Blank slides" => "Folien ausblenden", "NO OUTPUT DISPLAYED" => "KEINE AUSGABE ANGEZEIGT",
|
||||
"PRESENTING" => "PRÄSENTATION LÄUFT", "PREPARING OUTPUT" => "AUSGABE WIRD VORBEREITET",
|
||||
"Open PDF…" => "PDF öffnen…", "Open picture folder…" => "Bilderordner öffnen…", "Import notes…" => "Notizen importieren…",
|
||||
"Save notes" => "Notizen speichern", "Edit notes" => "Notizen bearbeiten", "Tools" => "Werkzeuge", "Off" => "Aus",
|
||||
"Pointer" => "Zeiger", "Arrow" => "Pfeil", "Highlighter" => "Textmarker", "Color" => "Farbe", "Size" => "Größe",
|
||||
"Undo" => "Rückgängig", "Clear" => "Löschen", "Balanced" => "Ausgewogen", "Slide focus" => "Folienfokus",
|
||||
"Notes first" => "Notizen zuerst", "Slides and notes" => "Folien und Notizen", "Header" => "Kopfzeile",
|
||||
"Header and footer" => "Kopf- und Fußzeile", "Keep header visible" => "Kopfzeile sichtbar lassen",
|
||||
"Keep footer visible" => "Fußzeile sichtbar lassen", "Elapsed time" => "Verstrichene Zeit", "Countdown" => "Countdown",
|
||||
"Duration" => "Dauer", "Reset timer" => "Timer zurücksetzen", "Start timer" => "Timer starten",
|
||||
"Pause timer" => "Timer pausieren", "Window mode" => "Fenstermodus", "Follow global" => "Globaler Einstellung folgen",
|
||||
"Always fullscreen" => "Immer Vollbild", "Always windowed" => "Immer im Fenster", "Swap groups" => "Gruppen tauschen",
|
||||
"Presenter fullscreen" => "Präsentator im Vollbild", "Slides fullscreen" => "Folien im Vollbild",
|
||||
"Apply and remember" => "Anwenden und merken", "Exit fullscreen" => "Vollbild verlassen",
|
||||
"Enter fullscreen" => "Vollbild öffnen", "Slide preview" => "Folienvorschau", "Preview size" => "Vorschaugröße",
|
||||
"Compact" => "Kompakt", "Large" => "Groß", "Safe browsing" => "Sicheres Durchsuchen",
|
||||
"Live browsing" => "Live-Durchsuchen", "Change on click" => "Bei Klick wechseln", "Show selected" => "Auswahl zeigen",
|
||||
"Enable page zoom" => "Seitenzoom aktivieren", "Page zoom" => "Seitenzoom", "Reset zoom" => "Zoom zurücksetzen",
|
||||
"Memory and cache" => "Speicher und Cache", "Disk cache" => "Datenträgercache",
|
||||
"Storage and preparation" => "Speicher und Vorbereitung", "Quit presentation?" => "Präsentation beenden?",
|
||||
"Quit presentation" => "Präsentation beenden", "This closes Presenter and all Slides windows." => "Dadurch werden der Präsentator und alle Folienfenster geschlossen.",
|
||||
"Swap displays…" => "Bildschirme tauschen…", "Go to slide" => "Zu Folie springen",
|
||||
"Keep these display settings?" => "Diese Bildschirmeinstellungen behalten?", "Keep changes" => "Änderungen behalten",
|
||||
"Revert now" => "Jetzt zurücksetzen", "Apply changes" => "Änderungen anwenden", "Selected" => "Ausgewählt",
|
||||
"Processed slides" => "Verarbeitete Folien"
|
||||
)
|
||||
}
|
||||
|
||||
fn pt_br(text: &str) -> &str {
|
||||
catalog!(text;
|
||||
"Cancel" => "Cancelar", "Close" => "Fechar", "Retry" => "Tentar novamente", "Quit" => "Sair",
|
||||
"Theme" => "Tema", "Language" => "Idioma", "Appearance" => "Aparência",
|
||||
"Preferences" => "Preferências", "Preferences…" => "Preferências…", "Quick settings" => "Configurações rápidas",
|
||||
"Menu" => "Menu", "Displays" => "Telas", "All slides" => "Todos os slides", "Layout" => "Layout",
|
||||
"Layout…" => "Layout…", "Presenter layout" => "Layout do apresentador", "Presenter" => "Apresentador",
|
||||
"Slides" => "Slides", "Single screen" => "Tela única", "Unused" => "Não usada", "Previous" => "Anterior",
|
||||
"Current" => "Atual", "Next" => "Próximo", "PREVIOUS" => "ANTERIOR", "CURRENT" => "ATUAL", "NEXT" => "PRÓXIMO",
|
||||
"Previous slide" => "Slide anterior", "Current slide" => "Slide atual", "Next slide" => "Próximo slide",
|
||||
"No slide" => "Sem slide", "End of slides" => "Fim dos slides", "Notes" => "Notas",
|
||||
"No notes for this slide" => "Sem notas para este slide", "Show slides" => "Mostrar slides",
|
||||
"Blank slides" => "Ocultar slides", "NO OUTPUT DISPLAYED" => "NENHUMA SAÍDA EXIBIDA",
|
||||
"PRESENTING" => "APRESENTANDO", "PREPARING OUTPUT" => "PREPARANDO A SAÍDA",
|
||||
"Open PDF…" => "Abrir PDF…", "Open picture folder…" => "Abrir pasta de imagens…",
|
||||
"Import notes…" => "Importar notas…", "Save notes" => "Salvar notas", "Edit notes" => "Editar notas",
|
||||
"Tools" => "Ferramentas", "Off" => "Desativado", "Pointer" => "Ponteiro", "Arrow" => "Seta",
|
||||
"Highlighter" => "Marca-texto", "Color" => "Cor", "Size" => "Tamanho", "Undo" => "Desfazer", "Clear" => "Limpar",
|
||||
"Balanced" => "Equilibrado", "Slide focus" => "Foco no slide", "Notes first" => "Notas primeiro",
|
||||
"Slides and notes" => "Slides e notas", "Header" => "Cabeçalho", "Header and footer" => "Cabeçalho e rodapé",
|
||||
"Keep header visible" => "Manter cabeçalho visível", "Keep footer visible" => "Manter rodapé visível",
|
||||
"Elapsed time" => "Tempo decorrido", "Countdown" => "Contagem regressiva", "Duration" => "Duração",
|
||||
"Reset timer" => "Reiniciar cronômetro", "Start timer" => "Iniciar cronômetro", "Pause timer" => "Pausar cronômetro",
|
||||
"Window mode" => "Modo de janela", "Follow global" => "Seguir configuração global",
|
||||
"Always fullscreen" => "Sempre em tela cheia", "Always windowed" => "Sempre em janela",
|
||||
"Swap groups" => "Trocar grupos", "Presenter fullscreen" => "Apresentador em tela cheia",
|
||||
"Slides fullscreen" => "Slides em tela cheia", "Apply and remember" => "Aplicar e lembrar",
|
||||
"Exit fullscreen" => "Sair da tela cheia", "Enter fullscreen" => "Entrar em tela cheia",
|
||||
"Slide preview" => "Prévia do slide", "Preview size" => "Tamanho da prévia", "Compact" => "Compacto", "Large" => "Grande",
|
||||
"Safe browsing" => "Navegação segura", "Live browsing" => "Navegação ao vivo", "Change on click" => "Alterar ao clicar",
|
||||
"Show selected" => "Mostrar selecionado", "Enable page zoom" => "Ativar zoom da página", "Page zoom" => "Zoom da página",
|
||||
"Reset zoom" => "Redefinir zoom", "Memory and cache" => "Memória e cache", "Disk cache" => "Cache em disco",
|
||||
"Storage and preparation" => "Armazenamento e preparação", "Quit presentation?" => "Sair da apresentação?",
|
||||
"Quit presentation" => "Sair da apresentação", "This closes Presenter and all Slides windows." => "Isso fecha o Apresentador e todas as janelas de slides.",
|
||||
"Swap displays…" => "Trocar telas…", "Go to slide" => "Ir para o slide",
|
||||
"Keep these display settings?" => "Manter estas configurações de tela?", "Keep changes" => "Manter alterações",
|
||||
"Revert now" => "Reverter agora", "Apply changes" => "Aplicar alterações", "Selected" => "Selecionado",
|
||||
"Processed slides" => "Slides processados"
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn system_locales_resolve_supported_languages_without_misclassifying_scripts() {
|
||||
for (locale, expected) in [
|
||||
("fr_CA.UTF-8", ResolvedLanguage::Fr),
|
||||
("es-MX", ResolvedLanguage::Es),
|
||||
("ja_JP", ResolvedLanguage::Ja),
|
||||
("zh_CN.UTF-8", ResolvedLanguage::ZhCn),
|
||||
("zh-Hans-SG", ResolvedLanguage::ZhCn),
|
||||
("de-DE", ResolvedLanguage::De),
|
||||
("pt-BR", ResolvedLanguage::PtBr),
|
||||
("zh-TW", ResolvedLanguage::En),
|
||||
("zh-Hant", ResolvedLanguage::En),
|
||||
("pt-PT", ResolvedLanguage::En),
|
||||
("C", ResolvedLanguage::En),
|
||||
] {
|
||||
assert_eq!(resolve_system_locale(Some(locale)), expected, "{locale}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn catalogs_translate_core_presenter_controls_and_fall_back_to_english() {
|
||||
let ctx = egui::Context::default();
|
||||
for (language, expected) in [
|
||||
(Language::Fr, "Écrans"),
|
||||
(Language::Es, "Pantallas"),
|
||||
(Language::Ja, "ディスプレイ"),
|
||||
(Language::ZhCn, "显示器"),
|
||||
(Language::De, "Bildschirme"),
|
||||
(Language::PtBr, "Telas"),
|
||||
] {
|
||||
apply(&ctx, &language);
|
||||
assert_eq!(tr(&ctx, "Displays"), expected);
|
||||
assert_eq!(
|
||||
tr(&ctx, "untranslated diagnostic"),
|
||||
"untranslated diagnostic"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn embedded_cjk_faces_render_selected_interface_scripts() {
|
||||
let ctx = egui::Context::default();
|
||||
for (language, sample) in [
|
||||
(Language::Ja, "日本語スライド"),
|
||||
(Language::ZhCn, "简体中文幻灯片"),
|
||||
] {
|
||||
apply(&ctx, &language);
|
||||
let _ = ctx.run_ui(egui::RawInput::default(), |ui| {
|
||||
ui.fonts_mut(|fonts| {
|
||||
let galley = fonts.layout_no_wrap(
|
||||
sample.into(),
|
||||
egui::FontId::proportional(18.0),
|
||||
egui::Color32::WHITE,
|
||||
);
|
||||
assert_eq!(galley.text(), sample);
|
||||
assert!(
|
||||
galley.rows[0]
|
||||
.glyphs
|
||||
.iter()
|
||||
.all(|glyph| !glyph.uv_rect.is_nothing()),
|
||||
"missing glyph in {language:?}"
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -193,6 +193,8 @@ struct NativeWindow {
|
|||
zoom_watch: crate::zoom::PerformanceWatch,
|
||||
zoom_slow: bool,
|
||||
presentation_base: Option<PresentationBase>,
|
||||
applied_theme: Option<crate::theme::Theme>,
|
||||
applied_language: Option<crate::localization::Language>,
|
||||
#[cfg(target_os = "linux")]
|
||||
browser_parent: Option<WindowId>,
|
||||
}
|
||||
|
|
@ -253,6 +255,8 @@ impl NativeWindow {
|
|||
zoom_watch: Default::default(),
|
||||
zoom_slow: false,
|
||||
presentation_base: None,
|
||||
applied_theme: None,
|
||||
applied_language: None,
|
||||
#[cfg(target_os = "linux")]
|
||||
browser_parent: None,
|
||||
})
|
||||
|
|
@ -336,8 +340,14 @@ impl NativeWindow {
|
|||
return Err("Display exceeds 40 megapixels".into());
|
||||
}
|
||||
if let Some(s) = studio.as_ref() {
|
||||
s.settings.theme.apply(&self.ctx);
|
||||
crate::localization::apply(&self.ctx, &s.settings.language);
|
||||
if self.applied_theme != Some(s.settings.theme) {
|
||||
s.settings.theme.apply(&self.ctx);
|
||||
self.applied_theme = Some(s.settings.theme);
|
||||
}
|
||||
if self.applied_language != Some(s.settings.language) {
|
||||
crate::localization::apply(&self.ctx, &s.settings.language);
|
||||
self.applied_language = Some(s.settings.language);
|
||||
}
|
||||
}
|
||||
let input = self.input.take_egui_input(&self.window);
|
||||
let role = self.role;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use crate::localization::tr;
|
||||
use crate::localization::{display_revert_countdown, tr};
|
||||
// Native controls for the approved presenter layout and safe slide browser.
|
||||
use crate::{
|
||||
settings::{Layout, TimerMode, TimerPosition},
|
||||
|
|
@ -904,13 +904,7 @@ fn presenter_view(
|
|||
background.context_menu(|ui| {
|
||||
if !s.presentation_started
|
||||
&& s.route_trial.is_none()
|
||||
&& ui
|
||||
.button(if s.settings.language.french() {
|
||||
"Inverser les écrans…"
|
||||
} else {
|
||||
"Swap displays…"
|
||||
})
|
||||
.clicked()
|
||||
&& ui.button(tr(&locale, "Swap displays…")).clicked()
|
||||
{
|
||||
s.actions.push(Action::SwapRoutes);
|
||||
ui.close();
|
||||
|
|
@ -1443,17 +1437,9 @@ fn presenter_view(
|
|||
egui::Frame::popup(ui.style()).show(ui, |ui| {
|
||||
ui.label(format!(
|
||||
"{} {} · {}",
|
||||
if s.settings.language.french() {
|
||||
"Diapositive"
|
||||
} else {
|
||||
"Go to slide"
|
||||
},
|
||||
tr(&locale, "Go to slide"),
|
||||
s.jump,
|
||||
if s.settings.language.french() {
|
||||
"Entrée : diffuser · Retour arrière : effacer"
|
||||
} else {
|
||||
"Enter to show · Backspace to clear"
|
||||
}
|
||||
tr(&locale, "Enter to show · Backspace to clear")
|
||||
));
|
||||
});
|
||||
});
|
||||
|
|
@ -1465,39 +1451,22 @@ fn presenter_view(
|
|||
.as_secs()
|
||||
+ 1;
|
||||
egui::Modal::new(egui::Id::new("confirm-displays")).show(&ctx, |ui| {
|
||||
ui.heading(if s.settings.language.french() {
|
||||
"Conserver ces écrans ?"
|
||||
} else {
|
||||
"Keep these display settings?"
|
||||
});
|
||||
ui.label(if s.settings.language.french() {
|
||||
"Une seule confirmation suffit pour tous les écrans."
|
||||
} else {
|
||||
"Confirm once on any screen to apply to all displays."
|
||||
});
|
||||
ui.label(if s.settings.language.french() {
|
||||
format!("Retour automatique dans {seconds} s. Échap pour annuler.")
|
||||
} else {
|
||||
format!("Automatically reverts in {seconds} seconds. Escape to revert.")
|
||||
});
|
||||
ui.heading(tr(&locale, "Keep these display settings?"));
|
||||
ui.label(tr(
|
||||
&locale,
|
||||
"Confirm once on any screen to apply to all displays.",
|
||||
));
|
||||
ui.label(display_revert_countdown(&locale, seconds));
|
||||
ui.horizontal(|ui| {
|
||||
button(
|
||||
ui,
|
||||
if s.settings.language.french() {
|
||||
"Conserver"
|
||||
} else {
|
||||
"Keep changes"
|
||||
},
|
||||
tr(&locale, "Keep changes"),
|
||||
Action::KeepRoutes,
|
||||
&mut s.actions,
|
||||
);
|
||||
button(
|
||||
ui,
|
||||
if s.settings.language.french() {
|
||||
"Annuler"
|
||||
} else {
|
||||
"Revert now"
|
||||
},
|
||||
tr(&locale, "Revert now"),
|
||||
Action::RevertRoutes,
|
||||
&mut s.actions,
|
||||
);
|
||||
|
|
@ -1552,11 +1521,7 @@ fn presenter_view(
|
|||
ui.visuals_mut().slider_trailing_fill = true;
|
||||
if display.is_some() {
|
||||
ui.horizontal(|ui| {
|
||||
ui.strong(if s.settings.language.french() {
|
||||
"Modifier la disposition de"
|
||||
} else {
|
||||
"Edit layout for"
|
||||
});
|
||||
ui.strong(tr(&locale, "Edit layout for"));
|
||||
let selected = selected_layout_display
|
||||
.as_ref()
|
||||
.and_then(|selected| {
|
||||
|
|
@ -1578,11 +1543,10 @@ fn presenter_view(
|
|||
}
|
||||
});
|
||||
});
|
||||
ui.label(if s.settings.language.french() {
|
||||
"Disposition et sauvegardes propres à cet écran. Le fonctionnement du minuteur reste partagé."
|
||||
} else {
|
||||
"Layout and saves apply to this display. Timer behavior is shared."
|
||||
});
|
||||
ui.label(tr(
|
||||
&locale,
|
||||
"Layout and saves apply to this display. Timer behavior is shared.",
|
||||
));
|
||||
}
|
||||
ui.label(tr(
|
||||
&locale,
|
||||
|
|
@ -1713,14 +1677,8 @@ fn presenter_view(
|
|||
});
|
||||
layout_section(ui, tr(&locale, "Header and footer"), |ui| {
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
ui.checkbox(
|
||||
&mut layout.header,
|
||||
tr(&locale, "Keep header visible"),
|
||||
);
|
||||
ui.checkbox(
|
||||
&mut layout.footer,
|
||||
tr(&locale, "Keep footer visible"),
|
||||
);
|
||||
ui.checkbox(&mut layout.header, tr(&locale, "Keep header visible"));
|
||||
ui.checkbox(&mut layout.footer, tr(&locale, "Keep footer visible"));
|
||||
});
|
||||
ui.small(tr(
|
||||
&locale,
|
||||
|
|
@ -1735,14 +1693,27 @@ fn presenter_view(
|
|||
button(
|
||||
ui,
|
||||
tr(&locale, "Save layout · This project"),
|
||||
rendered_layout_display.as_deref().map_or(Action::SaveProject, |display| Action::SaveDisplayLayout { display: display.into(), project: true, layout: layout.clone() }),
|
||||
rendered_layout_display.as_deref().map_or(
|
||||
Action::SaveProject,
|
||||
|display| Action::SaveDisplayLayout {
|
||||
display: display.into(),
|
||||
project: true,
|
||||
layout: layout.clone(),
|
||||
},
|
||||
),
|
||||
&mut s.actions,
|
||||
);
|
||||
});
|
||||
button(
|
||||
ui,
|
||||
tr(&locale, "Save layout · All projects"),
|
||||
rendered_layout_display.as_deref().map_or(Action::SaveGlobal, |display| Action::SaveDisplayLayout { display: display.into(), project: false, layout: layout.clone() }),
|
||||
rendered_layout_display
|
||||
.as_deref()
|
||||
.map_or(Action::SaveGlobal, |display| Action::SaveDisplayLayout {
|
||||
display: display.into(),
|
||||
project: false,
|
||||
layout: layout.clone(),
|
||||
}),
|
||||
&mut s.actions,
|
||||
);
|
||||
});
|
||||
|
|
@ -1751,7 +1722,11 @@ fn presenter_view(
|
|||
button(
|
||||
ui,
|
||||
tr(&locale, "Use all-projects default"),
|
||||
rendered_layout_display.as_deref().map_or(Action::UseGlobal, |display| Action::UseDisplayDefault(display.into())),
|
||||
rendered_layout_display
|
||||
.as_deref()
|
||||
.map_or(Action::UseGlobal, |display| {
|
||||
Action::UseDisplayDefault(display.into())
|
||||
}),
|
||||
&mut s.actions,
|
||||
);
|
||||
});
|
||||
|
|
@ -1889,11 +1864,7 @@ fn presenter_view(
|
|||
);
|
||||
button(
|
||||
ui,
|
||||
if s.settings.language.french() {
|
||||
"Appliquer les modifications"
|
||||
} else {
|
||||
"Apply changes"
|
||||
},
|
||||
tr(&locale, "Apply changes"),
|
||||
Action::ApplyRoutes,
|
||||
&mut s.actions,
|
||||
);
|
||||
|
|
@ -2274,37 +2245,21 @@ pub fn browser(ui: &mut Ui, s: &mut Studio, native: &mut UiState) {
|
|||
ui.add_space(4.);
|
||||
ui.label(format!(
|
||||
"{} {} · {} {}",
|
||||
if s.settings.language.french() {
|
||||
"Sélection"
|
||||
} else {
|
||||
"Selected"
|
||||
},
|
||||
tr(&locale, "Selected"),
|
||||
if s.count() == 0 {
|
||||
0
|
||||
} else {
|
||||
s.browser_selected + 1
|
||||
},
|
||||
if s.settings.language.french() {
|
||||
"Actuelle"
|
||||
} else {
|
||||
"Current"
|
||||
},
|
||||
tr(&locale, "Current"),
|
||||
if s.count() == 0 { 0 } else { s.requested + 1 },
|
||||
));
|
||||
if !s.jump.is_empty() {
|
||||
ui.label(format!(
|
||||
"{} {} — {}",
|
||||
if s.settings.language.french() {
|
||||
"Diapositive"
|
||||
} else {
|
||||
"Go to slide"
|
||||
},
|
||||
tr(&locale, "Go to slide"),
|
||||
s.jump,
|
||||
if s.settings.language.french() {
|
||||
"Entrée : diffuser, Retour arrière : effacer"
|
||||
} else {
|
||||
"Enter to show; Backspace to clear"
|
||||
}
|
||||
tr(&locale, "Enter to show; Backspace to clear")
|
||||
));
|
||||
}
|
||||
// Reserve a stable gutter, so neither thumbnail sizing nor scrollbar placement
|
||||
|
|
@ -2460,32 +2415,18 @@ fn preferences_window(ctx: &egui::Context, s: &mut Studio, open: &mut bool) {
|
|||
.show(ui, |ui| {
|
||||
layout_section(
|
||||
ui,
|
||||
if s.settings.language.french() {
|
||||
"Image des diapositives masquées"
|
||||
} else {
|
||||
"Blank Slides image"
|
||||
},
|
||||
tr(&locale, "Blank Slides image"),
|
||||
|ui| {
|
||||
ui.label(if s.settings.blank_picture {
|
||||
if s.settings.language.french() {
|
||||
"Image personnalisée sélectionnée"
|
||||
} else {
|
||||
"Custom picture selected"
|
||||
}
|
||||
} else if s.settings.language.french() {
|
||||
"Écran noir"
|
||||
tr(&locale, "Custom picture selected")
|
||||
} else {
|
||||
"Solid black"
|
||||
tr(&locale, "Solid black")
|
||||
});
|
||||
ui.horizontal_wrapped(|ui| {
|
||||
if ui
|
||||
.add_enabled(
|
||||
s.initialized && !s.dialog_busy && !s.blank_busy,
|
||||
egui::Button::new(if s.settings.language.french() {
|
||||
"Choisir une image…"
|
||||
} else {
|
||||
"Choose picture…"
|
||||
}),
|
||||
egui::Button::new(tr(&locale, "Choose picture…")),
|
||||
)
|
||||
.clicked()
|
||||
{
|
||||
|
|
@ -2496,11 +2437,7 @@ fn preferences_window(ctx: &egui::Context, s: &mut Studio, open: &mut bool) {
|
|||
s.initialized
|
||||
&& !s.dialog_busy
|
||||
&& (s.settings.blank_picture || s.blank_busy),
|
||||
egui::Button::new(if s.settings.language.french() {
|
||||
"Utiliser un écran noir"
|
||||
} else {
|
||||
"Use solid black"
|
||||
}),
|
||||
egui::Button::new(tr(&locale, "Use solid black")),
|
||||
)
|
||||
.clicked()
|
||||
{
|
||||
|
|
@ -2510,11 +2447,10 @@ fn preferences_window(ctx: &egui::Context, s: &mut Studio, open: &mut bool) {
|
|||
ui.spinner();
|
||||
}
|
||||
});
|
||||
ui.small(if s.settings.language.french() {
|
||||
"Une copie est conservée et ajustée à tous les écrans de diapositives, sur fond noir."
|
||||
} else {
|
||||
"A copy is saved and fitted to all Slides screens against a black background."
|
||||
});
|
||||
ui.small(tr(
|
||||
&locale,
|
||||
"A copy is saved and fitted to all Slides screens against a black background.",
|
||||
));
|
||||
},
|
||||
);
|
||||
#[cfg(target_os = "windows")]
|
||||
|
|
@ -2522,32 +2458,22 @@ fn preferences_window(ctx: &egui::Context, s: &mut Studio, open: &mut bool) {
|
|||
ui.add_space(8.);
|
||||
layout_section(
|
||||
ui,
|
||||
if s.settings.language.french() {
|
||||
"Application PDF par défaut"
|
||||
} else {
|
||||
"Default PDF application"
|
||||
},
|
||||
tr(&locale, "Default PDF application"),
|
||||
|ui| {
|
||||
ui.label(if s.settings.language.french() {
|
||||
"Enregistre PDF Presenter et son icône pour les fichiers PDF de votre compte Windows."
|
||||
} else {
|
||||
"Register PDF Presenter and its icon for PDF files in your Windows account."
|
||||
});
|
||||
ui.label(tr(
|
||||
&locale,
|
||||
"Register PDF Presenter and its icon for PDF files in your Windows account.",
|
||||
));
|
||||
if ui
|
||||
.button(if s.settings.language.french() {
|
||||
"Définir comme application PDF par défaut…"
|
||||
} else {
|
||||
"Set as default PDF app…"
|
||||
})
|
||||
.button(tr(&locale, "Set as default PDF app…"))
|
||||
.clicked()
|
||||
{
|
||||
s.actions.push(Action::RegisterPdfAssociation);
|
||||
}
|
||||
ui.small(if s.settings.language.french() {
|
||||
"Windows ouvrira Applications par défaut : sélectionnez PDF Presenter pour .pdf afin de confirmer."
|
||||
} else {
|
||||
"Windows will open Default Apps; select PDF Presenter for .pdf to confirm."
|
||||
});
|
||||
ui.small(tr(
|
||||
&locale,
|
||||
"Windows will open Default Apps; select PDF Presenter for .pdf to confirm.",
|
||||
));
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
@ -2618,11 +2544,7 @@ fn preferences_window(ctx: &egui::Context, s: &mut Studio, open: &mut bool) {
|
|||
ui.separator();
|
||||
ui.label(format!(
|
||||
"{}: {}",
|
||||
if s.settings.language.french() {
|
||||
"Diapositives préparées"
|
||||
} else {
|
||||
"Processed slides"
|
||||
},
|
||||
tr(&locale, "Processed slides"),
|
||||
s.cache_path.display()
|
||||
));
|
||||
ui.label(format!("Configuration: {}", s.settings_path.display()));
|
||||
|
|
@ -2691,11 +2613,11 @@ fn menu(ui: &mut Ui, s: &mut Studio, preferences_open: &mut bool) {
|
|||
.strong()
|
||||
.color(ui.visuals().weak_text_color()),
|
||||
);
|
||||
ui.menu_button(s.settings.theme.name().to_owned(), |ui| {
|
||||
ui.menu_button(s.settings.theme.name(), |ui| {
|
||||
for theme in crate::theme::Theme::ALL {
|
||||
let name = theme.name();
|
||||
changed |= ui
|
||||
.selectable_value(&mut s.settings.theme, theme.clone(), name)
|
||||
.selectable_value(&mut s.settings.theme, theme, name)
|
||||
.changed();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ const MUTED: Color32 = Color32::from_rgb(165, 181, 201);
|
|||
const CYAN: Color32 = Color32::from_rgb(102, 219, 239);
|
||||
const AMBER: Color32 = Color32::from_rgb(246, 197, 119);
|
||||
const PURPLE: Color32 = Color32::from_rgb(102, 85, 217);
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum Theme {
|
||||
#[default]
|
||||
|
|
@ -76,7 +76,7 @@ impl Theme {
|
|||
Self::VerdantRebel,
|
||||
Self::WeicatIndustrial,
|
||||
];
|
||||
pub fn name(&self) -> &str {
|
||||
pub fn name(&self) -> &'static str {
|
||||
match self {
|
||||
Self::Midra => "Midra Dark",
|
||||
Self::HighContrast => "High Contrast",
|
||||
|
|
@ -276,6 +276,10 @@ impl Theme {
|
|||
}
|
||||
}
|
||||
pub fn apply(&self, ctx: &egui::Context) {
|
||||
let applied = egui::Id::new("pdf-presenter-theme");
|
||||
if ctx.data(|data| data.get_temp::<Self>(applied)) == Some(*self) {
|
||||
return;
|
||||
}
|
||||
let p = self.palette();
|
||||
let mut v = if self.is_light() {
|
||||
egui::Visuals::light()
|
||||
|
|
@ -317,6 +321,7 @@ impl Theme {
|
|||
w.fg_stroke = egui::Stroke::new(1_f32, p.text);
|
||||
}
|
||||
ctx.set_visuals(v);
|
||||
ctx.data_mut(|data| data.insert_temp(applied, *self));
|
||||
}
|
||||
}
|
||||
fn sotv_palette(colors: [u32; 8], light: bool) -> Palette {
|
||||
|
|
@ -350,3 +355,19 @@ fn sotv_palette(colors: [u32; 8], light: bool) -> Palette {
|
|||
pattern: [layer, panel],
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn repeated_theme_application_keeps_the_existing_style() {
|
||||
let ctx = egui::Context::default();
|
||||
Theme::Midra.apply(&ctx);
|
||||
let first = ctx.global_style();
|
||||
Theme::Midra.apply(&ctx);
|
||||
assert!(std::sync::Arc::ptr_eq(&first, &ctx.global_style()));
|
||||
Theme::CorporateLight.apply(&ctx);
|
||||
assert!(!std::sync::Arc::ptr_eq(&first, &ctx.global_style()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -515,7 +515,7 @@ fn quick_settings_and_preferences_window_remain_interactive() {
|
|||
assert_eq!(s.settings.theme, pdf_presenter::theme::Theme::HighContrast);
|
||||
assert!(s.menu_open);
|
||||
click(&mut s, "English");
|
||||
click(&mut s, "System / Système");
|
||||
click(&mut s, "System language");
|
||||
assert_eq!(
|
||||
s.settings.language,
|
||||
pdf_presenter::localization::Language::System
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
use pdf_presenter::settings::{self, Layout, Routes, Settings};
|
||||
|
||||
#[test]
|
||||
fn every_interface_language_round_trips_through_settings_v1() {
|
||||
let temp = tempfile::tempdir().unwrap();
|
||||
for language in pdf_presenter::localization::Language::ALL {
|
||||
let path = temp.path().join(format!("{language:?}.toml"));
|
||||
let settings = Settings {
|
||||
language,
|
||||
..Default::default()
|
||||
};
|
||||
settings::write(&path, &settings).unwrap();
|
||||
assert_eq!(settings::read(&path).unwrap().language, language);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn settings_roundtrip_preserves_project_overrides_and_hidden_bars() {
|
||||
let temp = tempfile::tempdir().unwrap();
|
||||
|
|
|
|||
|
|
@ -2,6 +2,21 @@
|
|||
|
||||
## Unreleased
|
||||
|
||||
### 0.1.92
|
||||
|
||||
- Extend the existing Canvas Pilot-inspired appearance menu with Spanish, Japanese,
|
||||
Simplified Chinese, German and Brazilian Portuguese alongside English and French;
|
||||
System follows supported native locales and safely falls back to English.
|
||||
- Embed the OFL-licensed Noto Sans CJK collection for standalone Japanese and Chinese
|
||||
interface rendering. Catalog lookup is compiled and allocation-free; CJK fonts are
|
||||
installed only when selected and never read from disk at runtime.
|
||||
- Stop rebuilding theme visuals and locale/font state on every frame. Both now update
|
||||
only when their selection changes, keeping slide preparation, navigation and output
|
||||
rendering paths unchanged.
|
||||
- Linux formatting, warnings-denied Clippy/rustdoc, workspace tests, optimized build,
|
||||
13 Python helper tests and the native-window smoke pass. Full GUI coverage is
|
||||
83.89% against the 75% floor.
|
||||
|
||||
### 0.1.91
|
||||
|
||||
- Promote releases from preview status and add recurring Linux ARM64, Apple Silicon
|
||||
|
|
|
|||
|
|
@ -90,6 +90,28 @@ This includes pipe transfer to the measurement process, not optical display late
|
|||
One sample under concurrent build load is diagnostic evidence, not a p95/worst-case
|
||||
benchmark or comparison against Pympress. The source PDF remains untracked and unchanged.
|
||||
|
||||
## 0.1.92 themes and interface languages
|
||||
|
||||
The existing 20 built-in Canvas Pilot-inspired palettes remain compile-time data.
|
||||
English, French, Spanish, Japanese, Simplified Chinese, German and Brazilian
|
||||
Portuguese are selectable, with supported native locales resolved once per process.
|
||||
Translations use static match tables: there is no catalog parsing, runtime file I/O
|
||||
or translation allocation. Detailed worker and operating-system diagnostics retain
|
||||
their original wording.
|
||||
|
||||
Theme application and locale/font setup now short-circuit when the selected value is
|
||||
already active. Japanese and Simplified Chinese share one embedded Noto Sans CJK
|
||||
collection; the appropriate face is installed once when a CJK language is selected
|
||||
and egui's default embedded fonts are restored when leaving it. This work does not
|
||||
change the independent output process, prepared-frame navigation, PDF workers or
|
||||
slide texture path.
|
||||
|
||||
Linux workspace/native tests, formatting, warnings-denied Clippy/rustdoc, optimized
|
||||
build and 13 Python helper tests pass. Whole-application GUI coverage is 83.89%
|
||||
against the 75% floor. CJK tests exercise both selected font faces and every theme/
|
||||
language combination renders the Presenter, browser and popups. This does not replace
|
||||
native Japanese/Chinese visual review or physical multi-display acceptance.
|
||||
|
||||
## Remaining acceptance and hardening
|
||||
|
||||
- User physical Windows/macOS/Linux X11/Wayland matrix: routing, swap, mixed DPI,
|
||||
|
|
|
|||
|
|
@ -38,10 +38,16 @@ flushed temporary file. Unknown fields are ignored and not preserved on round tr
|
|||
`dupont_monsanto`, `eden_green`, `foxified_light`, `hci`, `iron_docks`, `peaceframe`,
|
||||
`rebel`, `sirius_mind`, `solarized`, `sons_of_banard`, `storm_pilot`,
|
||||
`tessier_ashpol`, `ustf`, `verdant_rebel`, `weicat_industrial`.
|
||||
- `language`: `system` (default), `en` or `fr` (0.1.14). Native OS locale selects
|
||||
French for `fr*`, English otherwise. Unknown theme/language values are rejected.
|
||||
- `language`: `system` (default), `en`, `fr`, `es`, `ja`, `zh_cn`, `de` or `pt_br`.
|
||||
Spanish, Japanese, Simplified Chinese, German and Brazilian Portuguese were added
|
||||
in 0.1.92. Native OS locale selects a supported language by language/script and
|
||||
region; Traditional Chinese and unsupported Portuguese regions fall back to
|
||||
English rather than silently selecting a different written standard.
|
||||
Unknown theme/language values are rejected.
|
||||
Missing new fields in older v1 files use these defaults; no migration is required.
|
||||
Theme, language and automatic-output changes persist asynchronously, globally.
|
||||
Catalog lookup is compiled, allocation-free and never reads files on the input or
|
||||
render path. Theme and font state is rebuilt only when the selection changes.
|
||||
- `layout`: `previous`, `current`, `next`, `notes`, `elapsed`, `clock`, each with
|
||||
boolean `show` and finite floating `size`; plus boolean `header`/`footer`.
|
||||
Previous/next sizes are relative weights 30–160, current 60–200; notes size
|
||||
|
|
|
|||
|
|
@ -291,13 +291,18 @@ The numbered screen rectangles in **Displays** reflect each monitor’s pixel as
|
|||
ratio, so portrait, standard and ultrawide displays are easier to distinguish.
|
||||
They represent proportions, not physical screen size.
|
||||
|
||||
Menu → Appearance → Theme offers the same 20 built-in palettes as Canvas Pilot, including light,
|
||||
dark and High Contrast. Menu → Appearance → Language offers System, English and Français. System
|
||||
uses the native OS locale and falls back to English for other languages. Choices are
|
||||
saved globally and apply to all presenter/browser windows; slides are never recolored.
|
||||
The controls and preparation progress are translated; detailed worker/OS diagnostics
|
||||
remain verbatim. Additional Canvas Pilot languages and external theme/language packs
|
||||
are not included in this version.
|
||||
Menu → Appearance → Theme offers the same 20 built-in palettes as Canvas Pilot,
|
||||
including light, dark and High Contrast. Menu → Appearance → Language offers System,
|
||||
English, French, Spanish, Japanese, Simplified Chinese, German and Brazilian
|
||||
Portuguese. System uses the native OS locale when it matches one of these choices and
|
||||
otherwise falls back to English. Traditional Chinese is not silently treated as
|
||||
Simplified Chinese. Choices are saved globally and apply to all presenter/browser
|
||||
windows; slides are never recolored.
|
||||
|
||||
Translations are built into the executable and need no runtime file reads. Japanese
|
||||
and Chinese use the bundled Noto Sans CJK font, loaded only when one of those languages
|
||||
is active. Theme styles and language fonts are rebuilt only when their selection
|
||||
changes. Detailed worker and operating-system diagnostics remain verbatim.
|
||||
|
||||
All slides opens a windowed browser above fullscreen windows and requests focus.
|
||||
Opening it again restores/focuses the existing browser. Its Close button dismisses it; Escape requests application quit confirmation.
|
||||
|
|
|
|||
|
|
@ -32,6 +32,14 @@ def main():
|
|||
f"License expression: {package['license']}\n"
|
||||
f"Source: {package.get('repository') or 'https://crates.io/crates/' + package['name']}\n"
|
||||
+ "\n".join(notices))
|
||||
font_license = ROOT / "crates/pdf-presenter/assets/fonts/OFL.txt"
|
||||
font_text = font_license.read_text()
|
||||
font_digest = hashlib.sha256(font_text.encode()).hexdigest()[:16]
|
||||
texts[font_digest] = font_text
|
||||
entries.insert(0, "Noto Sans CJK 2.004\n"
|
||||
"License expression: OFL-1.1\n"
|
||||
"Source: https://github.com/notofonts/noto-cjk/releases/tag/Sans2.004\n"
|
||||
f" assets/fonts/OFL.txt: text {font_digest}")
|
||||
header = ("PDF Presenter — locked dependency and font notices\n"
|
||||
"Generated by scripts/notices.py. Includes target/build-only dependencies;\n"
|
||||
"the presence of a package here does not mean it is linked on every OS.\n"
|
||||
|
|
|
|||
Loading…
Reference in New Issue