Skip to content

Commit

Permalink
Merge pull request #2124 from alerque/integrate-i18n
Browse files Browse the repository at this point in the history
Consolodate locale related resources in language scope
  • Loading branch information
alerque authored Oct 3, 2024
2 parents caf1928 + 7a205d8 commit 6f62ffa
Show file tree
Hide file tree
Showing 73 changed files with 24 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ COPY ./ /src
WORKDIR /src

# Take note of SILE's supported locales so the final system can build localized messages
RUN ls i18n/ | sed 's/[.-].*$/_/;s/^/^/' | sort -u | grep -Ef - /usr/share/i18n/SUPPORTED > /etc/locale.gen
RUN ls -d languages/*/ | sed -e 's!/$!_!;s!.*/!^!' | sort -u | grep -Ef - /usr/share/i18n/SUPPORTED > /etc/locale.gen

# GitHub Actions builder stopped providing git history :(
# See feature request at https://github.com/actions/runner/issues/767
Expand Down
2 changes: 1 addition & 1 deletion build-aux/list-distfiles.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ am_list () {
printf '%s =' SILEDATA
finder core -name '*.lua' -not -name '*_spec.lua' -not -name 'version.lua' -not -name 'features.lua' -not -name 'pathsetup.lua'
finder classes inputters languages outputters packages shapers types typesetters pagebuilders -name '*.lua' -not -name '*_spec.lua'
finder classes i18n packages -name '*.ftl'
finder classes languages packages -name '*.ftl'
finder packages -name '*.svg'

printf '\n\n%s =' LUALIBRARIES
Expand Down
2 changes: 1 addition & 1 deletion core/languages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SILE.languageSupport = {
)
)
end
local ftlresource = string.format("i18n.%s", language)
local ftlresource = string.format("languages.%s.messages", language)
SU.debug("fluent", "Loading FTL resource", ftlresource, "into locale", language)
-- This needs to be set so that we load localizations into the right bundle,
-- but this breaks the sync enabled by the hook in the document.language
Expand Down
5 changes: 0 additions & 5 deletions i18n/tr.ftl

This file was deleted.

4 changes: 4 additions & 0 deletions languages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Supporting a language in SILE involves some combination of:
* A hyphenation patterns module
* Localization strings

## Localization strings

Each locale may have a `messages.ftl` file that provides translations of strings that may be output into documents.

## Hyphenation patterns

Hyphenation rules are typically handled via patterns for the Knuth-Liang hyphenation algorithm.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 15 additions & 0 deletions languages/tr/messages.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
bibliography-and = ve
bibliography-edited-by = { $name } tarafından düzenlendi
bibliography-et-al = ve ark.
bibliography-translated-by = { $name } tarafından tercüme edildi
book-chapter-title = Bölüm { $number }
hello = Merhaba <em>{ $name }</em>!
tableofcontents-not-generated = İçindekiler tablosunu işlemek için SİLE'yi yeniden çalıştırın!
tableofcontents-title = İçindekiler
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions i18n/und.ftl → languages/und/messages.ftl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
bibliography-et-al = <language main="la">et al</language>.
hello = Namárië <em>{ $name }</em>!
tableofcontents-not-generated = <language main="en">Rerun SILE to process the table of contents!</language>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 6f62ffa

Please sign in to comment.