From c008a5b800ff6557f2127bce771c7da3928b14e0 Mon Sep 17 00:00:00 2001 From: Caleb Maclennan Date: Sun, 27 Oct 2024 11:16:15 +0300 Subject: [PATCH] chore(crate): Spin up space for a French implementation --- Makefile.am | 2 +- pyproject.toml | 1 + src/fr.rs | 20 ++++++++++++++++++++ src/lib.rs | 5 +++++ src/types.rs | 1 + 5 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 src/fr.rs diff --git a/Makefile.am b/Makefile.am index f88dc46..b00999b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -12,7 +12,7 @@ licensedir = $(datarootdir)/licenses/$(TRANSFORMED_PACKAGE_NAME) bin_PROGRAMS = decasify decasify_SOURCES = src/bin/decasify.rs src/content.rs src/cli.rs src/lib.rs src/types.rs src/traits.rs decasify_SOURCES += src/lua.rs src/python.rs src/wasm.rs -decasify_SOURCES += src/en.rs src/tr.rs +decasify_SOURCES += src/en.rs src/fr.rs src/tr.rs EXTRA_decasify_SOURCES = tests/cli.rs tests/lib.rs EXTRA_DIST = pyproject.toml spec/decasify_spec.lua tests/test_all.py plugin/decasify.lua sile/decasify.lua dist_doc_DATA = README.md CHANGELOG.md diff --git a/pyproject.toml b/pyproject.toml index 0630848..42335c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,7 @@ classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Natural Language :: English", + "Natural Language :: French", "Natural Language :: Turkish", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", diff --git a/src/fr.rs b/src/fr.rs new file mode 100644 index 0000000..8c0657f --- /dev/null +++ b/src/fr.rs @@ -0,0 +1,20 @@ +// SPDX-FileCopyrightText: © 2023 Caleb Maclennan +// SPDX-License-Identifier: LGPL-3.0-only + +use crate::{Chunk, StyleGuide}; + +pub fn titlecase(_chunk: Chunk, _style: StyleGuide) -> String { + todo!(); +} + +pub fn lowercase(_chunk: Chunk) -> String { + todo!(); +} + +pub fn uppercase(_chunk: Chunk) -> String { + todo!(); +} + +pub fn sentencecase(_chunk: Chunk) -> String { + todo!(); +} diff --git a/src/lib.rs b/src/lib.rs index 7d07406..05f6de9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -30,6 +30,7 @@ pub mod python; pub mod wasm; mod en; +mod fr; mod tr; /// Convert a string to a specific case following typesetting conventions for a target locale @@ -62,6 +63,7 @@ pub fn titlecase( let style: StyleGuide = style.into(); match locale { Locale::EN => en::titlecase(chunk, style), + Locale::FR => fr::titlecase(chunk, style), Locale::TR => tr::titlecase(chunk, style), } } @@ -72,6 +74,7 @@ pub fn lowercase(chunk: impl Into, locale: impl Into) -> String { let locale: Locale = locale.into(); match locale { Locale::EN => en::lowercase(chunk), + Locale::FR => fr::lowercase(chunk), Locale::TR => tr::lowercase(chunk), } } @@ -82,6 +85,7 @@ pub fn uppercase(chunk: impl Into, locale: impl Into) -> String { let locale: Locale = locale.into(); match locale { Locale::EN => en::uppercase(chunk), + Locale::FR => fr::uppercase(chunk), Locale::TR => tr::uppercase(chunk), } } @@ -92,6 +96,7 @@ pub fn sentencecase(chunk: impl Into, locale: impl Into) -> Strin let locale: Locale = locale.into(); match locale { Locale::EN => en::sentencecase(chunk), + Locale::FR => fr::sentencecase(chunk), Locale::TR => tr::sentencecase(chunk), } } diff --git a/src/types.rs b/src/types.rs index 1d8454f..102154d 100644 --- a/src/types.rs +++ b/src/types.rs @@ -43,6 +43,7 @@ pub type Result = std::result::Result; pub enum Locale { #[default] EN, + FR, TR, }