Commit 2388baa1 authored by jan.koester's avatar jan.koester
Browse files

florium: German and English

Every domain has its own language (SITE/LANGUAGE): texts, BB code labels,
dates and mails. The administration has ADMIN/LANGUAGE, the setup wizard
follows the browser. Texts go through loc(), English in share/i18n/en.tsv,
tools/i18n_keys.py --missing checks the coverage. formatDate() instead of
cutting formatTime().

Co-Authored-By: default avatarClaude Opus 5.5 <noreply@anthropic.com>
parent 748b42dc
Loading
Loading
Loading
Loading
Loading
+2 −1
Changes for CMakeLists.txt: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ add_executable(florium
    src/mail.cpp
    src/image.cpp
    src/media.cpp
    src/i18n.cpp
)

target_link_libraries(florium PRIVATE
@@ -68,5 +69,5 @@ target_link_libraries(florium PRIVATE
install(TARGETS florium RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES share/layout.html share/florium.css share/florium.js
        DESTINATION ${CMAKE_INSTALL_DATADIR}/florium)
install(DIRECTORY share/themes DESTINATION ${CMAKE_INSTALL_DATADIR}/florium)
install(DIRECTORY share/themes share/i18n DESTINATION ${CMAKE_INSTALL_DATADIR}/florium)
install(FILES docker/florium.yaml DESTINATION ${CMAKE_INSTALL_DATADIR}/florium/examples)
+10 −0
Changes for README.md: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -67,6 +67,16 @@ The role is checked again every 5 minutes, a removed fenrirds session logs
the user out. Accounts are created in fenrirds (`SITE/REGISTERURL` links to
its sign up page); florium only keeps a local profile and can ban.

## Languages

German and English. Every forum has its own language (`SITE/LANGUAGE` of
the domain, set in the administration): all texts, the BB code labels
(quote/code boxes), dates and the registration mails follow it. The
administration has its own `ADMIN/LANGUAGE` (server settings; the setup
wizard follows the browser). The German texts in the source are the keys,
the English ones live in `share/i18n/en.tsv`; `tools/i18n_keys.py --missing`
lists texts without a translation.

## Setup wizard, administration, domains

Without `/etc/florium/florium.yaml` florium starts a **setup wizard** on
+3 −0
Changes for docker/entrypoint.sh: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -10,6 +10,8 @@
#
#   FLORIUM_DOMAIN                 host names of the first forum, comma-separated
#   FLORIUM_ADMIN_USER / _PASSWORD administration login (port FLORIUM_ADMIN_PORT, default 8081)
#   FLORIUM_ADMIN_LANGUAGE         de | en: language of the administration
#   FLORIUM_LANGUAGE               de | en: language of the first forum (each domain has its own)
#
#   FLORIUM_TITLE / FLORIUM_DESCRIPTION / FLORIUM_BASEPATH / FLORIUM_LANGUAGE (de|en)
#   FLORIUM_PORT                   (default 8080)
@@ -93,6 +95,7 @@ if [ ! -e "$CONF" ] && [ -n "${FLORIUM_DOMAIN:-}" ]; then
        echo "    PORT: ${FLORIUM_ADMIN_PORT:-8081}"
        # plain text here, the administration stores it hashed when the password is set there
        echo "    USERS: $(q "${FLORIUM_ADMIN_USER:-admin}:${FLORIUM_ADMIN_PASSWORD:-}")"
        echo "    LANGUAGE: $(q "${FLORIUM_ADMIN_LANGUAGE:-de}")"
        echo "  DOMAINS:"
        echo "    - NAME: $(q "${FLORIUM_DOMAIN%%,*}")"
        if [ "${FLORIUM_DOMAIN#*,}" != "$FLORIUM_DOMAIN" ]; then
+14 −4
Changes for share/florium.js: 14 added lines, 4 removed lines.
Original line number Diff line number Diff line
// florium editor: BB code buttons, smilies and the quote button
var FLORIUM_TEXT = (function () {
  var en = (document.documentElement.lang || "de") === "en";
  return {
    url: en ? "URL:" : "URL:",
    img: en ? "Image URL:" : "Bild-URL:",
    color: en ? "Colour (e.g. red or #336699):" : "Farbe (z.B. red oder #336699):",
    uploadFailed: en ? "Upload failed." : "Upload fehlgeschlagen."
  };
})();

(function () {
  "use strict";

@@ -28,13 +38,13 @@
    }
    var tag = b.dataset.bb;
    if (tag === "url") {
      var u = prompt("URL:", "https://");
      var u = prompt(FLORIUM_TEXT.url, "https://");
      if (u) wrap(area, "[url=" + u + "]", "[/url]");
    } else if (tag === "img") {
      var i = prompt("Bild-URL:", "https://");
      var i = prompt(FLORIUM_TEXT.img, "https://");
      if (i) insert(area, "[img]" + i + "[/img]");
    } else if (tag === "color") {
      var c = prompt("Farbe (z.B. red oder #336699):", "red");
      var c = prompt(FLORIUM_TEXT.color, "red");
      if (c) wrap(area, "[color=" + c + "]", "[/color]");
    } else if (tag === "list") {
      wrap(area, "[list]\n[*]", "\n[/list]");
@@ -75,7 +85,7 @@
        area.value = v.substring(0, s) + j.bbcode + v.substring(s);
        area.focus();
      })
      .catch(function () { alert("Upload fehlgeschlagen."); })
      .catch(function () { alert(FLORIUM_TEXT.uploadFailed); })
      .finally(function () { input.value = ""; if (label) label.classList.remove("busy"); });
  });

share/i18n/en.tsv

0 → 100644
+455 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading