mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-26 15:07:42 +00:00
font-manager: the panel's Japanese and Arabic rows, exported for an app's Host
This commit is contained in:
@@ -110,9 +110,20 @@ adds is an index at an https URL; its families are never curated.
|
||||
|
||||
## Strings
|
||||
|
||||
Every interface string goes through craft-i18n with the English text as the key. The panel embeds
|
||||
its own Japanese and Arabic catalogs (`src/panel/catalogs/`) until its rows are part of
|
||||
craft-i18n; style and weight names, licence names and product names stay in English.
|
||||
Every interface string is a word of the Host's `I18n` (`craft_ui::words!`), so the panel is in the Host's
|
||||
language when the app's catalogs have its rows and in English where they have none. `CATALOGS` holds the
|
||||
Japanese and Arabic rows, until they are part of craft-i18n's shared catalog, as data the app passes to
|
||||
its Host's `I18n`:
|
||||
|
||||
```rust
|
||||
// An app with no shared catalog of its own; one with a shared catalog joins the rows to it for
|
||||
// `I18n::from_owned`.
|
||||
let (i18n, problems) = craft_i18n::I18n::new(craft_font_manager::CATALOGS, &["ja", "ar"]);
|
||||
let lang = i18n.match_tag(language).unwrap_or(craft_i18n::Lang::EN);
|
||||
Host::builder(app).i18n(Arc::new(i18n)).lang(lang).install(ctx);
|
||||
```
|
||||
|
||||
Style and weight names, licence names and product names stay in English.
|
||||
|
||||
## Testing
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ pub use craft_font_catalog;
|
||||
pub use craft_font_catalog::{Catalog, FaceInfo, FontEnv, Source};
|
||||
#[cfg(feature = "ui")]
|
||||
pub use panel::{
|
||||
FontSources, FontSourcesOutput, FontsBrowseWords, FontsCommand, FontsPanel, FontsPanelOutput, FontsPanelSettings, FontsPanelView,
|
||||
CATALOGS, FontSources, FontSourcesOutput, FontsBrowseWords, FontsCommand, FontsPanel, FontsPanelOutput, FontsPanelSettings, FontsPanelView,
|
||||
FontsPanelWords, Options, Preset, Tab, install_interface_fonts,
|
||||
};
|
||||
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
# Arabic (ar) rows of the Fonts panel's words, for an app's shared catalog.
|
||||
# Format: context<TAB>source<TAB>translation; @id rows name a word by its id, @plural rows list the locale's plural forms.
|
||||
# Style and weight names (Regular, Bold, Italic), licence names and product names stay in English.
|
||||
@id fontsPanel.sansSerif بلا زوائد
|
||||
@id fontsPanel.serif بزوائد
|
||||
@id fontsPanel.display عرض
|
||||
@id fontsPanel.handwriting خط اليد
|
||||
@id fontsPanel.monospace أحادي المسافة
|
||||
@id fontsPanel.fontStore متجر الخطوط
|
||||
@id fontsPanel.system النظام
|
||||
@id fontsPanel.settingFailed تعذّر حفظ إعداد التنزيل: {error}
|
||||
@id fontsPanel.consentNote يبقى التنزيل مسموحًا حتى توقفه.
|
||||
@id fontsPanel.consentAllow تنزيل
|
||||
@id fontsBrowse.tabBrowse تصفّح
|
||||
@id fontsBrowse.tabInstalled مثبّت
|
||||
@id fontsBrowse.search بحث
|
||||
@id fontsBrowse.searchCatalogue ابحث في الخطوط بالاسم
|
||||
@id fontsBrowse.searchInstalled ابحث في الخطوط المثبّتة
|
||||
@id fontsBrowse.downloads التنزيلات
|
||||
@id fontsBrowse.allowDownloads السماح بالتنزيل
|
||||
@id fontsBrowse.category الفئة
|
||||
@id fontsBrowse.allCategories كل الفئات
|
||||
@id fontsBrowse.language اللغة
|
||||
@id fontsBrowse.anyLanguage أي لغة
|
||||
@id fontsBrowse.languagePlaceholder الاسم بالإنجليزية أو باللغة نفسها
|
||||
@id fontsBrowse.findLanguage ابحث عن لغة
|
||||
@id fontsBrowse.script نظام الكتابة
|
||||
@id fontsBrowse.anyScript أي نظام كتابة
|
||||
@id fontsBrowse.source المصدر
|
||||
@id fontsBrowse.allSources كل المصادر
|
||||
@id fontsBrowse.show إظهار
|
||||
@id fontsBrowse.allFonts كل الخطوط
|
||||
@id fontsBrowse.installed مثبّت
|
||||
@id fontsBrowse.notInstalled غير مثبّت
|
||||
@id fontsBrowse.clearFilters مسح عوامل التصفية
|
||||
@id fontsBrowse.installedNote تستخدم كل تطبيقات Craft الخطوط الموجودة في متجر الخطوط. تُضاف خطوط النظام وتُزال بأدوات الخطوط في نظامك.
|
||||
@id fontsBrowse.sample العينة
|
||||
@id fontsBrowse.sentence جملة
|
||||
@id fontsBrowse.alphabet الأبجدية
|
||||
@id fontsBrowse.numerals الأرقام والرموز
|
||||
@id fontsBrowse.sampleText نص العينة
|
||||
@id fontsBrowse.size الحجم
|
||||
@id fontsBrowse.downloadsOff التنزيل متوقف
|
||||
@id fontsBrowse.downloadsOffText تظهر عينة الخط غير المثبّت بعد معاينته. لا يُنزَّل شيء حتى تسمح بذلك.
|
||||
@id fontsBrowse.noMatch لا توجد خطوط مطابقة
|
||||
@id fontsBrowse.noMatchHint جرّب اسمًا آخر أو عوامل تصفية أقل.
|
||||
@id fontsBrowse.clearSearch مسح البحث وعوامل التصفية
|
||||
@id fontsBrowse.indexesUnreadable تتعذّر قراءة فهارس الخطوط: {error}
|
||||
@id fontsBrowse.sourceError {source}: {error}
|
||||
@id fontsBrowse.tryAgain إعادة المحاولة
|
||||
@id fontsBrowse.looking جارٍ البحث عن الخطوط المثبّتة…
|
||||
@id fontsBrowse.noInstalled لا توجد خطوط مثبّتة مطابقة
|
||||
@id fontsBrowse.installedEmpty تظهر هنا الخطوط التي تثبّتها من «تصفّح»، لكل تطبيقات Craft.
|
||||
@id fontsBrowse.tryName جرّب اسمًا آخر.
|
||||
@id fontsBrowse.installing جارٍ التثبيت
|
||||
@id fontsBrowse.removing جارٍ الإزالة
|
||||
@id fontsBrowse.downloading جارٍ التنزيل
|
||||
@id fontsBrowse.retry إعادة المحاولة
|
||||
@id fontsBrowse.failedInstall تعذّر التثبيت
|
||||
@id fontsBrowse.failedRemove تعذّرت الإزالة
|
||||
@id fontsBrowse.failedDownload تعذّر التنزيل
|
||||
@id fontsBrowse.install تثبيت
|
||||
@id fontsBrowse.installFamily تثبيت {family}
|
||||
@id fontsBrowse.preview معاينة
|
||||
@id fontsBrowse.previewFamily معاينة {family}
|
||||
@id fontsBrowse.remove إزالة
|
||||
@id fontsBrowse.removeFamily إزالة {family}
|
||||
@id fontsBrowse.notCurated غير مراجَع
|
||||
@id fontsBrowse.notCuratedTip تأتي هذه العائلة من مصدر أضفته. لا يراجعها Craft.
|
||||
@id fontsBrowse.cardSample العينة
|
||||
@id fontDetails.designedBy تصميم {designer}
|
||||
@id fontDetails.installing جارٍ التثبيت
|
||||
@id fontDetails.removing جارٍ الإزالة
|
||||
@id fontDetails.downloading جارٍ التنزيل
|
||||
@id fontDetails.installed مثبّت
|
||||
@id fontDetails.installedOnSystem مثبّت على هذا النظام
|
||||
@id fontDetails.installAll تثبيت الكل
|
||||
@id fontDetails.removeAll إزالة الكل
|
||||
@id fontDetails.preview معاينة
|
||||
@id fontDetails.install تثبيت
|
||||
@id fontDetails.remove إزالة
|
||||
@id fontDetails.installStyle تثبيت {style}
|
||||
@id fontDetails.removeStyle إزالة {style}
|
||||
@id fontDetails.downloadSizeLine تنزيل {size}
|
||||
@id fontDetails.previewNote تنزّل المعاينة هذا الخط ({size}) لهذه الجلسة فقط دون تثبيته.
|
||||
@id fontDetails.notCurated غير مراجَع
|
||||
@id fontDetails.notCuratedNote تأتي هذه العائلة من مصدر أضفته ({url}). لا يراجع Craft خطوطه ولا تراخيصها.
|
||||
@id fontDetails.couldntInstall تعذّر التثبيت
|
||||
@id fontDetails.couldntRemove تعذّرت الإزالة
|
||||
@id fontDetails.couldntDownload تعذّر التنزيل
|
||||
@id fontDetails.retry إعادة المحاولة
|
||||
@id fontDetails.systemFontsNote تُزال خطوط النظام بأدوات الخطوط في نظامك.
|
||||
@id fontDetails.systemFontsRemoval يُزال بأدوات الخطوط في نظامك
|
||||
@id fontDetails.source المصدر
|
||||
@id fontDetails.designer المصمم
|
||||
@id fontDetails.licence الترخيص
|
||||
@id fontDetails.stylesFact الأنماط
|
||||
@id fontDetails.filesFact الملفات
|
||||
@id fontDetails.downloadSize حجم التنزيل
|
||||
@id fontDetails.scripts أنظمة الكتابة
|
||||
@id fontDetails.languages اللغات · {n}
|
||||
@id fontDetails.languagesMore {list} و{n} غيرها
|
||||
@id fontSources.remove إزالة
|
||||
@id fontSources.removeSource إزالة {source}
|
||||
@id fontSources.notCurated غير مراجَع
|
||||
@id fontSources.changed تغيّر منذ إضافته
|
||||
@id fontSources.changedNote الفهرس على هذا العنوان ليس الذي نُزِّل منه أول مرة. تحقّق من المصدر قبل التثبيت منه.
|
||||
@id fontSources.addASource إضافة مصدر
|
||||
@id fontSources.add إضافة
|
||||
@id fontSources.indexAddress عنوان الفهرس
|
||||
@id fontSources.addWarning المصدر الذي تضيفه لا يُراجَع: أضف فقط الفهارس التي تثق بها. يُتحقَّق من كل خط مقابل فهرسه قبل استخدامه.
|
||||
@id fontSources.downloading جارٍ تنزيل المصادر…
|
||||
@id fontSources.update تحديث المصادر
|
||||
@id fontSources.allowToUpdate اسمح بالتنزيل للتحديث
|
||||
@id fontSources.added أُضيف. يُنزَّل عند السماح بالتنزيل.
|
||||
@id fontSources.couldntAdd تعذّرت إضافة المصدر: {error}
|
||||
@id fontSources.couldntRemove تعذّرت إزالة المصدر: {error}
|
||||
@id common.cancel إلغاء
|
||||
@id common.close إغلاق
|
||||
@plural {n} style|{n} styles {n} نمط|{n} نمط|{n} نمط|{n} أنماط|{n} نمطًا|{n} نمط
|
||||
@plural {n} family|{n} families {n} عائلة|{n} عائلة|{n} عائلة|{n} عائلات|{n} عائلة|{n} عائلة
|
||||
@plural {n} font source couldn't be loaded|{n} font sources couldn't be loaded تعذّر تحميل {n} مصدر خطوط|تعذّر تحميل {n} مصدر خطوط|تعذّر تحميل {n} مصدر خطوط|تعذّر تحميل {n} مصادر خطوط|تعذّر تحميل {n} مصدرًا للخطوط|تعذّر تحميل {n} مصدر خطوط
|
||||
@plural {n} style installed|{n} styles installed {n} نمط مثبّت|{n} نمط مثبّت|{n} نمط مثبّت|{n} أنماط مثبّتة|{n} نمطًا مثبّتًا|{n} نمط مثبّت
|
||||
|
@@ -0,0 +1,123 @@
|
||||
# Japanese (ja) rows of the Fonts panel's words, for an app's shared catalog.
|
||||
# Format: context<TAB>source<TAB>translation; @id rows name a word by its id, @plural rows list the locale's plural forms.
|
||||
# Style and weight names (Regular, Bold, Italic), licence names and product names stay in English.
|
||||
@id fontsPanel.sansSerif サンセリフ
|
||||
@id fontsPanel.serif セリフ
|
||||
@id fontsPanel.display ディスプレイ
|
||||
@id fontsPanel.handwriting 手書き
|
||||
@id fontsPanel.monospace 等幅
|
||||
@id fontsPanel.fontStore フォントストア
|
||||
@id fontsPanel.system システム
|
||||
@id fontsPanel.settingFailed ダウンロードの設定を保存できませんでした: {error}
|
||||
@id fontsPanel.consentNote ダウンロードは、オフにするまで許可されたままです。
|
||||
@id fontsPanel.consentAllow ダウンロード
|
||||
@id fontsBrowse.tabBrowse 探す
|
||||
@id fontsBrowse.tabInstalled インストール済み
|
||||
@id fontsBrowse.search 検索
|
||||
@id fontsBrowse.searchCatalogue フォントを名前で検索
|
||||
@id fontsBrowse.searchInstalled インストール済みのフォントを検索
|
||||
@id fontsBrowse.downloads ダウンロード
|
||||
@id fontsBrowse.allowDownloads ダウンロードを許可
|
||||
@id fontsBrowse.category カテゴリ
|
||||
@id fontsBrowse.allCategories すべてのカテゴリ
|
||||
@id fontsBrowse.language 言語
|
||||
@id fontsBrowse.anyLanguage すべての言語
|
||||
@id fontsBrowse.languagePlaceholder 英語名またはその言語での名前
|
||||
@id fontsBrowse.findLanguage 言語を検索
|
||||
@id fontsBrowse.script 文字体系
|
||||
@id fontsBrowse.anyScript すべての文字体系
|
||||
@id fontsBrowse.source 入手元
|
||||
@id fontsBrowse.allSources すべての入手元
|
||||
@id fontsBrowse.show 表示
|
||||
@id fontsBrowse.allFonts すべてのフォント
|
||||
@id fontsBrowse.installed インストール済み
|
||||
@id fontsBrowse.notInstalled 未インストール
|
||||
@id fontsBrowse.clearFilters 絞り込みを解除
|
||||
@id fontsBrowse.installedNote フォントストアのフォントはすべての Craft アプリで使えます。システムフォントの追加と削除は、システムのフォント管理ツールで行います。
|
||||
@id fontsBrowse.sample サンプル
|
||||
@id fontsBrowse.sentence 文
|
||||
@id fontsBrowse.alphabet アルファベット
|
||||
@id fontsBrowse.numerals 数字と記号
|
||||
@id fontsBrowse.sampleText サンプルテキスト
|
||||
@id fontsBrowse.size サイズ
|
||||
@id fontsBrowse.downloadsOff ダウンロードはオフです
|
||||
@id fontsBrowse.downloadsOffText インストールしていないフォントは、プレビューするとサンプルが表示されます。許可するまで何もダウンロードされません。
|
||||
@id fontsBrowse.noMatch 一致するフォントはありません
|
||||
@id fontsBrowse.noMatchHint 別の名前を試すか、絞り込みを減らしてください。
|
||||
@id fontsBrowse.clearSearch 検索と絞り込みを解除
|
||||
@id fontsBrowse.indexesUnreadable フォントの一覧を読み込めません: {error}
|
||||
@id fontsBrowse.sourceError {source}: {error}
|
||||
@id fontsBrowse.tryAgain もう一度試す
|
||||
@id fontsBrowse.looking インストール済みのフォントを探しています…
|
||||
@id fontsBrowse.noInstalled 一致するインストール済みフォントはありません
|
||||
@id fontsBrowse.installedEmpty 「探す」からインストールしたフォントがここに表示され、すべての Craft アプリで使えます。
|
||||
@id fontsBrowse.tryName 別の名前を試してください。
|
||||
@id fontsBrowse.installing インストール中
|
||||
@id fontsBrowse.removing 削除中
|
||||
@id fontsBrowse.downloading ダウンロード中
|
||||
@id fontsBrowse.retry 再試行
|
||||
@id fontsBrowse.failedInstall インストールできませんでした
|
||||
@id fontsBrowse.failedRemove 削除できませんでした
|
||||
@id fontsBrowse.failedDownload ダウンロードできませんでした
|
||||
@id fontsBrowse.install インストール
|
||||
@id fontsBrowse.installFamily {family} をインストール
|
||||
@id fontsBrowse.preview プレビュー
|
||||
@id fontsBrowse.previewFamily {family} をプレビュー
|
||||
@id fontsBrowse.remove 削除
|
||||
@id fontsBrowse.removeFamily {family} を削除
|
||||
@id fontsBrowse.notCurated 未審査
|
||||
@id fontsBrowse.notCuratedTip このファミリーは追加したソースのものです。Craft は審査していません。
|
||||
@id fontsBrowse.cardSample サンプル
|
||||
@id fontDetails.designedBy デザイン: {designer}
|
||||
@id fontDetails.installing インストール中
|
||||
@id fontDetails.removing 削除中
|
||||
@id fontDetails.downloading ダウンロード中
|
||||
@id fontDetails.installed インストール済み
|
||||
@id fontDetails.installedOnSystem このシステムにインストール済み
|
||||
@id fontDetails.installAll すべてインストール
|
||||
@id fontDetails.removeAll すべて削除
|
||||
@id fontDetails.preview プレビュー
|
||||
@id fontDetails.install インストール
|
||||
@id fontDetails.remove 削除
|
||||
@id fontDetails.installStyle {style} をインストール
|
||||
@id fontDetails.removeStyle {style} を削除
|
||||
@id fontDetails.downloadSizeLine ダウンロード {size}
|
||||
@id fontDetails.previewNote プレビューでは、このフォント ({size}) をこのセッションの間だけダウンロードし、インストールはしません。
|
||||
@id fontDetails.notCurated 未審査
|
||||
@id fontDetails.notCuratedNote このファミリーは追加したソース ({url}) のものです。Craft はフォントもライセンスも審査していません。
|
||||
@id fontDetails.couldntInstall インストールできませんでした
|
||||
@id fontDetails.couldntRemove 削除できませんでした
|
||||
@id fontDetails.couldntDownload ダウンロードできませんでした
|
||||
@id fontDetails.retry 再試行
|
||||
@id fontDetails.systemFontsNote システムフォントは、システムのフォント管理ツールで削除します。
|
||||
@id fontDetails.systemFontsRemoval システムのフォントツールで削除します
|
||||
@id fontDetails.source 入手元
|
||||
@id fontDetails.designer デザイナー
|
||||
@id fontDetails.licence ライセンス
|
||||
@id fontDetails.stylesFact スタイル
|
||||
@id fontDetails.filesFact ファイル
|
||||
@id fontDetails.downloadSize ダウンロードサイズ
|
||||
@id fontDetails.scripts 文字体系
|
||||
@id fontDetails.languages 言語 · {n}
|
||||
@id fontDetails.languagesMore {list} ほか {n} 言語
|
||||
@id fontSources.remove 削除
|
||||
@id fontSources.removeSource {source} を削除
|
||||
@id fontSources.notCurated 未審査
|
||||
@id fontSources.changed 追加後に変更あり
|
||||
@id fontSources.changedNote このアドレスの一覧は、最初にダウンロードしたものと異なります。インストールする前にソースを確認してください。
|
||||
@id fontSources.addASource ソースを追加
|
||||
@id fontSources.add 追加
|
||||
@id fontSources.indexAddress 一覧のアドレス
|
||||
@id fontSources.addWarning 追加したソースは審査されません。信頼できる一覧だけを追加してください。どのフォントも、使う前に一覧と照合されます。
|
||||
@id fontSources.downloading ソースをダウンロードしています…
|
||||
@id fontSources.update ソースを更新
|
||||
@id fontSources.allowToUpdate 更新するにはダウンロードを許可してください
|
||||
@id fontSources.added 追加しました。ダウンロードを許可するとダウンロードされます。
|
||||
@id fontSources.couldntAdd ソースを追加できませんでした: {error}
|
||||
@id fontSources.couldntRemove ソースを削除できませんでした: {error}
|
||||
@id common.cancel キャンセル
|
||||
@id common.close 閉じる
|
||||
@plural {n} style|{n} styles {n} スタイル
|
||||
@plural {n} family|{n} families {n} ファミリー
|
||||
@plural {n} font source couldn't be loaded|{n} font sources couldn't be loaded {n} 件のフォントソースを読み込めませんでした
|
||||
@plural {n} style installed|{n} styles installed インストール済み {n} スタイル
|
||||
|
@@ -1,4 +1,10 @@
|
||||
//! The interface languages the panel offers.
|
||||
//! The interface languages the panel offers, and its words in them.
|
||||
|
||||
use craft_i18n::Embedded;
|
||||
|
||||
/// The interface languages offered, in menu order.
|
||||
pub const LANGUAGES: &[&str] = &["en", "ja", "ar"];
|
||||
|
||||
/// The panel's words in Japanese and Arabic: the shared catalogs an app gives the `I18n` of its Host, alone or after its
|
||||
/// own shared rows. A word without a row shows in English.
|
||||
pub const CATALOGS: &Embedded = &[("ja", include_str!("catalogs/ja.tsv"), ""), ("ar", include_str!("catalogs/ar.tsv"), "")];
|
||||
|
||||
@@ -19,4 +19,5 @@ pub use app::{
|
||||
FontsCommand, FontsPanel, FontsPanelOutput, FontsPanelSettings, FontsPanelView, FontsPanelWords, Options, Preset, Tab, install_interface_fonts,
|
||||
};
|
||||
pub use browse::FontsBrowseWords;
|
||||
pub use i18n::CATALOGS;
|
||||
pub use sources::{FontSources, FontSourcesOutput};
|
||||
|
||||
@@ -11,10 +11,11 @@ use std::time::Duration;
|
||||
use craft_font_manager::craft_font_catalog::Os;
|
||||
use craft_font_manager::index::Index;
|
||||
use craft_font_manager::store::{Call, Conflict, FakeStore, Installer as _};
|
||||
use craft_font_manager::{Catalog, FontEnv, FontsPanel, FontsPanelView, Options};
|
||||
use craft_font_manager::{CATALOGS, Catalog, FontEnv, FontsPanel, FontsPanelView, Options};
|
||||
use craft_font_store::preview::{Fetch, Previews};
|
||||
use craft_font_store::{Cancel, FetchError};
|
||||
use craft_host::{AppInfo, Host, InlineJobs, Jobs, MemorySections};
|
||||
use craft_i18n::I18n;
|
||||
use craft_ui::contract::Role;
|
||||
use craft_ui::testing::focus::AccessActionKind;
|
||||
use craft_ui::testing::{Fixture, Room, Target, trial};
|
||||
@@ -606,6 +607,19 @@ fn a_variable_family_draws_one_subset_at_every_axis_value() {
|
||||
assert!(service.urls().is_empty(), "the slider asked for another subset");
|
||||
}
|
||||
|
||||
/// The rows the crate exports read without a problem, and a Host with them shows the panel in its language.
|
||||
#[trial]
|
||||
fn the_exported_rows_show_the_panel_in_japanese() {
|
||||
let (i18n, problems) = I18n::new(CATALOGS, &["ja", "ar"]);
|
||||
assert!(problems.is_empty() && i18n.check_all().is_empty(), "{problems:?} {:?}", i18n.check_all());
|
||||
let lang = i18n.from_code("ja").unwrap();
|
||||
let root = root("japanese");
|
||||
let store = Arc::new(FakeStore::new(root.join("store"), HashMap::new()));
|
||||
let panel = FontsPanel::new(Options::new(catalog(&root), store.clone(), Ok(index())));
|
||||
let rig = show(panel, store, Arc::new(Host::builder(APP).i18n(Arc::new(i18n)).lang(lang).jobs(Arc::new(InlineJobs)).build()));
|
||||
assert!(rig.present("すべてのカテゴリ") && !rig.present("All categories"));
|
||||
}
|
||||
|
||||
#[trial]
|
||||
fn default_filters_are_sans_serif_and_the_system_language() {
|
||||
let mut rig = setup("default-filters");
|
||||
|
||||
Reference in New Issue
Block a user