From 3556e93043deef8818b7b644a7124bae6b0fded8 Mon Sep 17 00:00:00 2001 From: Shai Almog <67850168+shai-almog@users.noreply.github.com> Date: Wed, 11 Mar 2026 14:23:00 +0200 Subject: [PATCH] Another attempt to fix localization resource bundles --- .../com/codename1/impl/javase/CSSWatcher.java | 8 +++-- .../com/codename1/maven/CompileCSSMojo.java | 29 ++++++++++++++----- .../codename1/maven/CompileCSSMojoTest.java | 26 +++++++++++++---- .../initializr/WebsiteThemeNativeImpl.java | 2 +- 4 files changed, 49 insertions(+), 16 deletions(-) diff --git a/Ports/JavaSE/src/com/codename1/impl/javase/CSSWatcher.java b/Ports/JavaSE/src/com/codename1/impl/javase/CSSWatcher.java index c1e8266522..6141000822 100644 --- a/Ports/JavaSE/src/com/codename1/impl/javase/CSSWatcher.java +++ b/Ports/JavaSE/src/com/codename1/impl/javase/CSSWatcher.java @@ -151,9 +151,9 @@ File findLocalizationDirectory(File srcFile, String overrideInputs) { } /** - * Adds likely l10n locations derived from the CSS file and current working directory. + * Adds likely l10n/i18n locations derived from the CSS file and current working directory. *
We include relative common-module paths because JavaSE watch is often launched - * from the `javase` module while CSS/l10n are in `../common/src/main`.
+ * from the `javase` module while CSS/localization resources are in `../common/src/main`. */ void addLocalizationCandidates(File cssFile, ListThis intentionally does not require `.properties` files up-front because
diff --git a/maven/codenameone-maven-plugin/src/test/java/com/codename1/maven/CompileCSSMojoTest.java b/maven/codenameone-maven-plugin/src/test/java/com/codename1/maven/CompileCSSMojoTest.java
index 5ad00b673e..2c67e79e04 100644
--- a/maven/codenameone-maven-plugin/src/test/java/com/codename1/maven/CompileCSSMojoTest.java
+++ b/maven/codenameone-maven-plugin/src/test/java/com/codename1/maven/CompileCSSMojoTest.java
@@ -26,7 +26,7 @@ class CompileCSSMojoTest {
@Test
void addsLocalizationDirectoryToDesignerInvocation(@TempDir Path tempDir) throws Exception {
- Path projectDir = setupProject(tempDir, true);
+ Path projectDir = setupProject(tempDir, "l10n");
TestCompileCSSMojo mojo = createMojo(projectDir);
mojo.executeImpl();
@@ -40,7 +40,7 @@ void addsLocalizationDirectoryToDesignerInvocation(@TempDir Path tempDir) throws
@Test
void skipsLocalizationArgumentWhenDirectoryMissing(@TempDir Path tempDir) throws Exception {
- Path projectDir = setupProject(tempDir, false);
+ Path projectDir = setupProject(tempDir, null);
TestCompileCSSMojo mojo = createMojo(projectDir);
mojo.executeImpl();
@@ -51,7 +51,7 @@ void skipsLocalizationArgumentWhenDirectoryMissing(@TempDir Path tempDir) throws
@Test
void addsLocalizationArgumentWhenDirectoryIsEmpty(@TempDir Path tempDir) throws Exception {
- Path projectDir = setupProject(tempDir, false);
+ Path projectDir = setupProject(tempDir, null);
Files.createDirectories(projectDir.resolve("src/main/l10n"));
TestCompileCSSMojo mojo = createMojo(projectDir);
@@ -64,6 +64,20 @@ void addsLocalizationArgumentWhenDirectoryIsEmpty(@TempDir Path tempDir) throws
assertEquals(projectDir.resolve("src/main/l10n").toFile().getAbsolutePath(), args.get(index + 1));
}
+ @Test
+ void addsI18nDirectoryToDesignerInvocation(@TempDir Path tempDir) throws Exception {
+ Path projectDir = setupProject(tempDir, "i18n");
+ TestCompileCSSMojo mojo = createMojo(projectDir);
+
+ mojo.executeImpl();
+
+ List