getAllTranslationDict() {
+ return null;
+ }
+
+}
diff --git a/kernel-d-i18n/i18n-sdk/README.md b/kernel-d-i18n/i18n-sdk/README.md
new file mode 100644
index 000000000..2deb2ce3d
--- /dev/null
+++ b/kernel-d-i18n/i18n-sdk/README.md
@@ -0,0 +1 @@
+多语言模块的sdk
diff --git a/kernel-d-i18n/i18n-sdk/pom.xml b/kernel-d-i18n/i18n-sdk/pom.xml
new file mode 100644
index 000000000..907e6256b
--- /dev/null
+++ b/kernel-d-i18n/i18n-sdk/pom.xml
@@ -0,0 +1,29 @@
+
+
+ 4.0.0
+
+
+ cn.stylefeng.roses
+ kernel-d-i18n
+ 1.0.0
+ ../pom.xml
+
+
+ i18n-sdk
+
+ jar
+
+
+
+
+
+ cn.stylefeng.roses
+ i18n-api
+ 1.0.0
+
+
+
+
+
diff --git a/kernel-d-i18n/i18n-sdk/src/main/java/cn/stylefeng/roses/kernel/i18n/TranslationContainer.java b/kernel-d-i18n/i18n-sdk/src/main/java/cn/stylefeng/roses/kernel/i18n/TranslationContainer.java
new file mode 100644
index 000000000..45355e2bd
--- /dev/null
+++ b/kernel-d-i18n/i18n-sdk/src/main/java/cn/stylefeng/roses/kernel/i18n/TranslationContainer.java
@@ -0,0 +1,49 @@
+package cn.stylefeng.roses.kernel.i18n;
+
+import cn.stylefeng.roses.kernel.i18n.api.TranslationApi;
+import cn.stylefeng.roses.kernel.i18n.api.enums.TranslationEnum;
+import cn.stylefeng.roses.kernel.i18n.api.pojo.TranslationDict;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * 翻译字典的容器
+ *
+ * @author fengshuonan
+ * @date 2021/1/24 19:08
+ */
+public class TranslationContainer implements TranslationApi {
+
+ /**
+ * 所有翻译的条目的字典项
+ *
+ * key是语种,value是对应语种下的所有key value翻译值(第二个key是具体翻译项的编码)
+ */
+ private static final Map> TRAN_DICT_CONTAINER = new ConcurrentHashMap<>();
+
+ @Override
+ public void init(List translationDict) {
+
+ // 根据语种数量,创建多个语种的翻译Map
+ for (TranslationEnum type : TranslationEnum.values()) {
+ HashMap typeMap = new HashMap<>();
+ TRAN_DICT_CONTAINER.put(type, typeMap);
+ }
+
+ // 整理数据库中的字典
+ for (TranslationDict translationItem : translationDict) {
+ TranslationEnum translationLanguages = translationItem.getTranslationLanguages();
+ TRAN_DICT_CONTAINER.get(translationLanguages).put(translationItem.getTranCode(), translationItem.getTranValue());
+ }
+
+ }
+
+ @Override
+ public Map getTranslationDictByLanguage(TranslationEnum translationLanguages) {
+ return TRAN_DICT_CONTAINER.get(translationLanguages);
+ }
+
+}
diff --git a/kernel-d-i18n/i18n-sdk/src/main/java/cn/stylefeng/roses/kernel/i18n/listener/TranslationDictInitListener.java b/kernel-d-i18n/i18n-sdk/src/main/java/cn/stylefeng/roses/kernel/i18n/listener/TranslationDictInitListener.java
new file mode 100644
index 000000000..b7d3141c0
--- /dev/null
+++ b/kernel-d-i18n/i18n-sdk/src/main/java/cn/stylefeng/roses/kernel/i18n/listener/TranslationDictInitListener.java
@@ -0,0 +1,38 @@
+package cn.stylefeng.roses.kernel.i18n.listener;
+
+import cn.hutool.extra.spring.SpringUtil;
+import cn.stylefeng.roses.kernel.i18n.api.TranslationApi;
+import cn.stylefeng.roses.kernel.i18n.api.TranslationPersistenceApi;
+import cn.stylefeng.roses.kernel.i18n.api.pojo.TranslationDict;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.boot.context.event.ApplicationContextInitializedEvent;
+import org.springframework.context.ApplicationListener;
+
+import java.util.List;
+
+/**
+ * 初始化系统配置表
+ *
+ * 当spring装配好配置后,就去数据库读constants
+ *
+ * @author fengshuonan
+ * @date 2021/1/24 19:36
+ */
+@Slf4j
+public class TranslationDictInitListener implements ApplicationListener {
+
+ @Override
+ public void onApplicationEvent(ApplicationContextInitializedEvent applicationContextInitializedEvent) {
+
+ TranslationPersistenceApi tanTranslationPersistenceApi = SpringUtil.getBean(TranslationPersistenceApi.class);
+ TranslationApi translationApi = SpringUtil.getBean(TranslationApi.class);
+
+ // 从数据库读取字典
+ List allTranslationDict = tanTranslationPersistenceApi.getAllTranslationDict();
+ if (allTranslationDict != null) {
+ translationApi.init(allTranslationDict);
+ log.info("初始化所有的翻译字典" + allTranslationDict.size() + "条!");
+ }
+ }
+
+}
diff --git a/kernel-d-i18n/i18n-spring-boot-starter/README.md b/kernel-d-i18n/i18n-spring-boot-starter/README.md
new file mode 100644
index 000000000..60643e8bc
--- /dev/null
+++ b/kernel-d-i18n/i18n-spring-boot-starter/README.md
@@ -0,0 +1 @@
+多语言模块的spring boot自动配置
diff --git a/kernel-d-i18n/i18n-spring-boot-starter/pom.xml b/kernel-d-i18n/i18n-spring-boot-starter/pom.xml
new file mode 100644
index 000000000..cab3005fa
--- /dev/null
+++ b/kernel-d-i18n/i18n-spring-boot-starter/pom.xml
@@ -0,0 +1,29 @@
+
+
+ 4.0.0
+
+
+ cn.stylefeng.roses
+ kernel-d-i18n
+ 1.0.0
+ ../pom.xml
+
+
+ i18n-spring-boot-starter
+
+ jar
+
+
+
+
+
+ cn.stylefeng.roses
+ i18n-sdk
+ 1.0.0
+
+
+
+
+
diff --git a/kernel-d-i18n/i18n-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/i18n/starter/GunsTranslationAutoConfiguration.java b/kernel-d-i18n/i18n-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/i18n/starter/GunsTranslationAutoConfiguration.java
new file mode 100644
index 000000000..c76f913e8
--- /dev/null
+++ b/kernel-d-i18n/i18n-spring-boot-starter/src/main/java/cn/stylefeng/roses/kernel/i18n/starter/GunsTranslationAutoConfiguration.java
@@ -0,0 +1,14 @@
+package cn.stylefeng.roses.kernel.i18n.starter;
+
+import org.springframework.context.annotation.Configuration;
+
+/**
+ * 多语言翻译的自动配置
+ *
+ * @author fengshuonan
+ * @date 2021/1/24 16:42
+ */
+@Configuration
+public class GunsTranslationAutoConfiguration {
+
+}
diff --git a/kernel-d-i18n/i18n-spring-boot-starter/src/main/resources/META-INF/spring.factories b/kernel-d-i18n/i18n-spring-boot-starter/src/main/resources/META-INF/spring.factories
new file mode 100644
index 000000000..e82e4b724
--- /dev/null
+++ b/kernel-d-i18n/i18n-spring-boot-starter/src/main/resources/META-INF/spring.factories
@@ -0,0 +1,4 @@
+org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
+ cn.stylefeng.roses.kernel.i18n.starter.GunsTranslationAutoConfiguration
+org.springframework.context.ApplicationListener=\
+ cn.stylefeng.roses.kernel.i18n.listener.TranslationDictInitListener
diff --git a/kernel-d-i18n/pom.xml b/kernel-d-i18n/pom.xml
new file mode 100644
index 000000000..9e874e60a
--- /dev/null
+++ b/kernel-d-i18n/pom.xml
@@ -0,0 +1,36 @@
+
+
+ 4.0.0
+
+
+ cn.stylefeng.roses
+ roses-kernel
+ 1.0.0
+ ../pom.xml
+
+
+ kernel-d-i18n
+
+ pom
+
+
+ i18n-api
+ i18n-business
+ i18n-sdk
+ i18n-spring-boot-starter
+
+
+
+
+
+
+ cn.stylefeng.roses
+ kernel-a-rule
+ 1.0.0
+
+
+
+
+
diff --git a/pom.xml b/pom.xml
index de68c8474..db4791b8f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -49,6 +49,9 @@
kernel-d-file
+
+ kernel-d-i18n
+
kernel-d-sms