diff --git a/applications/content/config/ContentUiLabels.xml b/applications/content/config/ContentUiLabels.xml index 004a428f12..58df6ffe16 100644 --- a/applications/content/config/ContentUiLabels.xml +++ b/applications/content/config/ContentUiLabels.xml @@ -289,11 +289,11 @@ สร้างไฟล์ - Create New Blog + Create New Blog Créer un nouveau blog - Create New Art. + Create New Art. Créer un nouvel article diff --git a/framework/base/src/org/ofbiz/base/util/StringUtil.java b/framework/base/src/org/ofbiz/base/util/StringUtil.java index 95e93d8f3d..8fe9689939 100644 --- a/framework/base/src/org/ofbiz/base/util/StringUtil.java +++ b/framework/base/src/org/ofbiz/base/util/StringUtil.java @@ -452,9 +452,26 @@ public class StringUtil { return html; } + public static String htmlSpecialChars(String html) { return htmlSpecialChars(html, true, true, true); - } + } + + public static String fromHtmlToSpecialChars(String html, boolean doubleQuotes, boolean singleQuotes, boolean insertBR) { + html = StringUtil.replaceString(html, "&", "&"); + html = StringUtil.replaceString(html, "<", "<"); + html = StringUtil.replaceString(html, ">", ">"); + if (doubleQuotes) { + html = StringUtil.replaceString(html, """, "\""); + } + if (singleQuotes) { + html = StringUtil.replaceString(html, "'", "'"); + } + if (insertBR) { + html = StringUtil.replaceString(html, "
", "\n"); + } + return html; + } /** * Remove/collapse multiple newline characters diff --git a/framework/base/src/org/ofbiz/base/util/UtilXml.java b/framework/base/src/org/ofbiz/base/util/UtilXml.java index b11ae1d847..1581296448 100644 --- a/framework/base/src/org/ofbiz/base/util/UtilXml.java +++ b/framework/base/src/org/ofbiz/base/util/UtilXml.java @@ -389,6 +389,23 @@ public class UtilXml { return elements; } + /** Return a List of Node objects that have the given name and are immediate children of the given element; + * if name is null, all child elements will be included. */ + public static List childNodeList(Node node) { + if (node == null) return null; + + List nodes = FastList.newInstance(); + + if (node != null) { + do { + if (node.getNodeType() == Node.ELEMENT_NODE || node.getNodeType() == Node.COMMENT_NODE) { + nodes.add(node); + } + } while ((node = node.getNextSibling()) != null); + } + return nodes; + } + /** Return the first child Element * returns the first element. */ public static Element firstChildElement(Element element, Set childElementNames) { @@ -516,6 +533,19 @@ public class UtilXml { } while ((textNode = textNode.getNextSibling()) != null); return valueBuffer.toString(); } + + /** Return the text (node value) of the first node under this */ + public static String nodeValue(Node node) { + if (node == null) return null; + + StringBuilder valueBuffer = new StringBuilder(); + do { + if (node.getNodeType() == Node.CDATA_SECTION_NODE || node.getNodeType() == Node.TEXT_NODE || node.getNodeType() == Node.COMMENT_NODE) { + valueBuffer.append(node.getNodeValue()); + } + } while ((node = node.getNextSibling()) != null); + return valueBuffer.toString(); + } public static String checkEmpty(String string) { if (string != null && string.length() > 0) diff --git a/framework/common/config/CommonEntityLabels.xml b/framework/common/config/CommonEntityLabels.xml index 09f055198f..b6ecede64d 100644 --- a/framework/common/config/CommonEntityLabels.xml +++ b/framework/common/config/CommonEntityLabels.xml @@ -13532,7 +13532,8 @@ Tasse Cup Taza - Cup (236,59 cm³) + Cup (236,59 cm³) + Tazza Taça Cupa diff --git a/framework/common/config/CommonUiLabels.xml b/framework/common/config/CommonUiLabels.xml index 48badd6d01..895fd1f8d6 100644 --- a/framework/common/config/CommonUiLabels.xml +++ b/framework/common/config/CommonUiLabels.xml @@ -2863,7 +2863,7 @@ ซ่อนฟิลด์ 隐藏域 隐藏字段 -
+ Home Point de départ @@ -7523,6 +7523,7 @@ eBay eBay eBay + eBay eBay อีเบย์ @@ -8171,6 +8172,10 @@ 新建数据源类型 增加新数据源类型 + + GeoLocation of requested element + Géolocalisation de l'élément demandé + تحرير مصدر المعلومات Datenquelle bearbeiten @@ -8201,10 +8206,6 @@ 编辑数据源类型 编辑数据源类型 - - GeoLocation of requested element - Géolocalisation de l'élément demandé - قائمة مصادر المعلومات Liste der Datenquellen diff --git a/framework/example/config/ExampleEntityLabels.xml b/framework/example/config/ExampleEntityLabels.xml index 3211a1cf8e..061f38599a 100644 --- a/framework/example/config/ExampleEntityLabels.xml +++ b/framework/example/config/ExampleEntityLabels.xml @@ -1,5 +1,6 @@ - - - Real World - Monde réel - Mondo Reale - สภาพที่เป็นจริง + + Desired + Désiré + Desiderato + ความต้องการ - - Made Up - Composé - Composto - ทำขึ้น + + Not Allowed + Non laissé + Non Permesso + ไม่อนุญาต + + + Required + Requis + Richiesto + ความต้องการ Contrived @@ -43,105 +49,18 @@ Inspirato ยอดเยี่ยม - - Required - Requis - Richiesto - ความต้องการ + + Made Up + Composé + Composto + ทำขึ้น - - Desired - Désiré - Desiderato - ความต้องการ - - - Not Allowed - Non laissé - Non Permesso - ไม่อนุญาต - - - - - Example ID - Réf. d'exemple - Codice Esempio - Cod Exemplu - รหัสตัวอย่าง - - - Example Type ID - Réf. de type d'exemple - Tipo esempio - รหัสประเภทตัวอย่าง - - - Example Item sequence ID - Réf. de séquence exemple d'article - Riga esempio - รหัสลำดับตัวอย่างสินค้า - - - Betrag - Amount - Montant - Importo - Import - จำนวน - - - Example Name - Nom d'exemple - Nome Esempio - Nume Exemplu - ชื่อตัวอย่าง - - - Long Description - Longue description - Descrizione Lunga - Descriere Lunga - รายละเอียด - - - Kommentare - Comments - Commentaires - Commenti - Comentarii - ความคิดเห็น - - - Example Size - Exemple de taille - Esempio Taglia - Marime-size Exemplu - ขนาดตัวอย่าง - - - Example Date - Exemple de date - Esempio Data - Data Exemplu - ตัวอย่างวันที่ - - - Another Date - Une autre date - Altra Data - วันที่อื่น ๆ - - - Another Text - Une autre texte - Altro Testo - ตัวอักษรอื่น ๆ + + + Real World + Monde réel + Mondo Reale + สภาพที่เป็นจริง A unique Example ID. If you don't assign an ID, one will be generated automatically @@ -161,4 +80,85 @@ Un tipo esempio univoco. Se tu non assegni un codice, uno verrà generato automaticamente รหัสตัวอย่างประเภท ถ้าไม่มีการกำหนดรหัส จะต้องมีการสร้างขึ้นอัตโมัติ + + Betrag + Amount + Montant + Importo + Import + จำนวน + + + Another Date + Une autre date + Altra Data + วันที่อื่น ๆ + + + Another Text + Une autre texte + Altro Testo + ตัวอักษรอื่น ๆ + + + Kommentare + Comments + Commentaires + Commenti + Comentarii + ความคิดเห็น + + + Example Date + Exemple de date + Esempio Data + Data Exemplu + ตัวอย่างวันที่ + + + + Example ID + Réf. d'exemple + Codice Esempio + Cod Exemplu + รหัสตัวอย่าง + + + Example Item sequence ID + Réf. de séquence exemple d'article + Riga esempio + รหัสลำดับตัวอย่างสินค้า + + + Example Name + Nom d'exemple + Nome Esempio + Nume Exemplu + ชื่อตัวอย่าง + + + Example Size + Exemple de taille + Esempio Taglia + Marime-size Exemplu + ขนาดตัวอย่าง + + + Example Type ID + Réf. de type d'exemple + Tipo esempio + รหัสประเภทตัวอย่าง + + + Long Description + Longue description + Descrizione Lunga + Descriere Lunga + รายละเอียด + diff --git a/framework/example/config/ExampleUiLabels.xml b/framework/example/config/ExampleUiLabels.xml index 03685464b5..07e43f3654 100644 --- a/framework/example/config/ExampleUiLabels.xml +++ b/framework/example/config/ExampleUiLabels.xml @@ -1,5 +1,6 @@ + + Ajax Examples + Exemples Ajax + Esempi Ajax + + + To use this Ajax demonstration, you must have JavaScript enabled on your browser. + Pour utiliser cette démonstration Ajax, vous devez avoir activé Javascript + Per usare questa dimostrazione Ajax, tu devi avere JavaScript abilitato sul tuo browser. + Example Application @@ -28,16 +39,6 @@ ตัวอย่างโปรแกรมคอมพิวเตอร์ 样例应用 - - To use this Ajax demonstration, you must have JavaScript enabled on your browser. - Pour utiliser cette démonstration Ajax, vous devez avoir activé Javascript - Per usare questa dimostrazione Ajax, tu devi avere JavaScript abilitato sul tuo browser. - - - Ajax Examples - Exemples Ajax - Esempi Ajax - OFBiz: Example OFBiz : Exemple @@ -74,15 +75,6 @@ 开源软件OFBiz家族的一部分 OFBiz的一部分 - - Example ID - Réf. exemple - Codice esempio - Cod Exemplu - Код примера - รหัสตัวอย่าง - 样例标识 - Example Exemple @@ -92,42 +84,6 @@ ตัวอย่าง 样例 - - Examples - Exemples - Esempi - Exemple - Примеры - ตัวอย่าง - 样例 - - - Feature - Caractéristique - Caratteristica - Caracteristica - Особенность - ลักษณะ - 特征 - - - Features - Caractéristiques - Caratteristiche - Caracteristici - Особенности - ลักษณะ - 特征 - - - Feature Source - Caractéristique d'origine - Caratteristica Origine - Origine Caracteristici - Источник особенности - ที่มา - 特征源 - Example Feature Caractéristique exemple @@ -146,17 +102,62 @@ ตัวอย่างรหัสลักษณะ 样例特征标识 + + Example ID + Réf. exemple + Codice esempio + Cod Exemplu + Код примера + รหัสตัวอย่าง + 样例标识 + + + Examples + Exemples + Esempi + Exemple + Примеры + ตัวอย่าง + 样例 + Explicit Option Option explicite Opzione Esplicita ทางเลือกที่ชัดเจน + + Feature + Caractéristique + Caratteristica + Caracteristica + Особенность + ลักษณะ + 特征 + + + Feature Source + Caractéristique d'origine + Caratteristica Origine + Origine Caracteristici + Источник особенности + ที่มา + 特征源 + + + Features + Caractéristiques + Caratteristiche + Caracteristici + Особенности + ลักษณะ + 特征 + This will print a simple PDF file which will show the FOP fonts avalaible in OFBiz Impression d'un simple fichier PDF qui montre les polices FOP disponibles dans OFBiz Questo stampa un file PDF semplice che mostrerà i font FOP disponibili in OFBiz - + Form Widget Examples Exemple de Form Widget @@ -230,84 +231,26 @@ ยินดีต้อนรับสู่ตัวอย่างโปรแกรม! 欢迎使用样例应用! - - - Find Example - Recherche d'un exemple - Ricerca Esempio - Cauta Exemplu - Найти пример - ค้นหาตัวอย่าง - 查找样例 + + Another Date + Une autre date + Altra Data + วันที่อื่น ๆ - - Form Widget Examples - Exemples Form Widget - Esempio form widget - ตัวอย่าง Widget + + Another Text + Un autre texte + Altro Testo + ตัวหนังสืออื่น ๆ - - Edit Example - Modifier l'exemple - Aggiorna Esempio - Actualizeaza Exemplu - Изменить пример - แก้ไขตัวอย่าง - 编辑样例 - - - Edit Example Items - Modifier la ligne de l'exemple - Aggiorna Righe Esempio - Actualizeaza Linii Exemplu - Изменить позиции примера - แก้ไขสินค้าตัวอย่าง - 编辑样例明细 - - - Edit Example Features - Modifier les caractéristiques de l'exemple - Aggiorna Caratteristiche Esempio - Actualizeaza Carateristici Exemplu - Изменить особенность примера - แก้ไขลักษณะตัวอย่าง - 编辑样例特征 - - - Find Example Feature - Rechercher la caractéristique de l'exemple - Ricerca Caratteristica Esempio - Cauta Caracteristica Exemplu - Найти особенность примера - ค้นหาลักษณะตัวอย่าง - 查找样例特征 - - - Edit Example Feature - Modifier la caractéristique de l'exemple - Aggiorna Caratteristica Esempio - Actualizeaza Caracteristica Exemplu - Изменить особенности примера - แก้ไขลักษณะตัวอย่าง - 编辑样例特征 - - - Edit Example Feature Examples - Modifier la caractéristique exemple des exemples - Aggiorna Esempio Caratteristica Esempi - Actualizeaza Exemplu Caratteristica Exemple - Изменить примеры особенностей - แก้ไขตัวอย่างลักษณะตัวอย่าง - 编辑样例特征的样例 - - - Lookup Example Feature - Rechercher la caractéristique exemple - Ricerca Caratteristica Esempio - Cauta Caracteristica Exemplu - Искать особенности примера - ดูลักษณะตัวอย่าง - 查找样例特征 + + Example Date + Exemple de date + Esempio Data + Data Exemplu + Дата примера + ตัวอย่างวันที่ + 样例日期 @@ -328,25 +271,83 @@ ตัวอย่างขนาด 样例尺寸 - - Example Date - Exemple de date - Esempio Data - Data Exemplu - Дата примера - ตัวอย่างวันที่ - 样例日期 + + Edit Example + Modifier l'exemple + Aggiorna Esempio + Actualizeaza Exemplu + Изменить пример + แก้ไขตัวอย่าง + 编辑样例 - - Another Date - Une autre date - Altra Data - วันที่อื่น ๆ + + Edit Example Feature + Modifier la caractéristique de l'exemple + Aggiorna Caratteristica Esempio + Actualizeaza Caracteristica Exemplu + Изменить особенности примера + แก้ไขลักษณะตัวอย่าง + 编辑样例特征 - - Another Text - Un autre texte - Altro Testo - ตัวหนังสืออื่น ๆ + + Edit Example Features + Modifier les caractéristiques de l'exemple + Aggiorna Caratteristiche Esempio + Actualizeaza Carateristici Exemplu + Изменить особенность примера + แก้ไขลักษณะตัวอย่าง + 编辑样例特征 + + + Edit Example Feature Examples + Modifier la caractéristique exemple des exemples + Aggiorna Esempio Caratteristica Esempi + Actualizeaza Exemplu Caratteristica Exemple + Изменить примеры особенностей + แก้ไขตัวอย่างลักษณะตัวอย่าง + 编辑样例特征的样例 + + + Edit Example Items + Modifier la ligne de l'exemple + Aggiorna Righe Esempio + Actualizeaza Linii Exemplu + Изменить позиции примера + แก้ไขสินค้าตัวอย่าง + 编辑样例明细 + + + + Find Example + Recherche d'un exemple + Ricerca Esempio + Cauta Exemplu + Найти пример + ค้นหาตัวอย่าง + 查找样例 + + + Find Example Feature + Rechercher la caractéristique de l'exemple + Ricerca Caratteristica Esempio + Cauta Caracteristica Exemplu + Найти особенность примера + ค้นหาลักษณะตัวอย่าง + 查找样例特征 + + + Form Widget Examples + Exemples Form Widget + Esempio form widget + ตัวอย่าง Widget + + + Lookup Example Feature + Rechercher la caractéristique exemple + Ricerca Caratteristica Esempio + Cauta Caracteristica Exemplu + Искать особенности примера + ดูลักษณะตัวอย่าง + 查找样例特征 diff --git a/framework/webtools/config/WebtoolsUiLabels.xml b/framework/webtools/config/WebtoolsUiLabels.xml index c142ebc80d..70fe5ce548 100644 --- a/framework/webtools/config/WebtoolsUiLabels.xml +++ b/framework/webtools/config/WebtoolsUiLabels.xml @@ -1420,6 +1420,22 @@ Fichier de Log File di log + + LHS map name + Nom de Map LHS + Nome mappa LHS + Nume mapa LHS + ชื่อแผนที่ LHS + 左手选择变换名称 + + + LHS value name + Nom de valeur LHS + Nome valore LHS + Nume valoare LHS + ชื่อค่า LHS + 左手选择值名称 + Label Manager Gestionnaire de traduction @@ -1498,37 +1514,21 @@ Impossible d'accèder à la page de gestion des traductions sans l'autorisation LABEL_MANAGER_VIEW. Non e posssibile visualizzare la pagina Gestione delle Label senza il permesso LABEL_MANAGER_VIEW. - - Update Labels Files - Mettre à jour les fichiers de traduction - Aggiorna files delle labels - Update Label Mettre à jour la traduction Aggiorna Label + + Update Labels Files + Mettre à jour les fichiers de traduction + Aggiorna files delle labels + There are some labels with more than translation for the same language Il y a des traduction dupliquées pour le même langage Ci sono alcune label con più di una traduzione per la stessa lingua - - LHS map name - Nom de Map LHS - Nome mappa LHS - Nume mapa LHS - ชื่อแผนที่ LHS - 左手选择变换名称 - - - LHS value name - Nom de valeur LHS - Nome valore LHS - Nume valoare LHS - ชื่อค่า LHS - 左手选择值名称 - leave all entries blank Laisser toutes les entrées vides @@ -1670,14 +1670,6 @@ หน่วยความจำ 内存 - - This page can be used to export data from the database - Cette page peut être utilisée pour exporter des données depuis la base - Questa pagine può essere usata per esportare i dati dal database - Aceasta pagina poate fi folosita pentru exportarea datelor din database - หน้านี้ใช้การส่งออกข้อมูลจากฐานข้อมูล - 本页面用于从数据库导出数据 - number of time the job will retry on error; use -1 for no limit or leave empty for service default Nombre de fois où le job sera relancé en cas d'erreur; utilisez -1 pour ne définir aucune limite ou laissez vide pour utilisez la valeur par défaut du service @@ -1718,15 +1710,6 @@ เพื่อความแน่ใจคุณควรเข้าสู่ระบบโดยใช้ ชื่อผูใช้: admin, รหัสผ่าน: ofbiz 如果你对其中的某些功能感兴趣,请先登录,可以尝试使用用户名:admin、密码:ofbiz登录 - - You do not have permission to view this page. ("OFBTOOLS_VIEW" or "OFBTOOLS_ADMIN" needed) - Vous n'avez pas l'autorisation de voir cette page ("OFBTOOLS_VIEW" ou "OFBTOOLS_ADMIN" nécessaire) - Non sei autorizzato a vedere questa pagina. (Necessario permesso "OFBTOOLS_VIEW" o "OFBTOOLS_ADMIN") - Nu esti autorizat sa vezi aceasta pagina. (Este necesar Permisul "OFBTOOLS_VIEW" sau "OFBTOOLS_ADMIN") - У вас нет прав для просмотра этой страницы. (необходимы права "OFBTOOLS_VIEW" или "OFBTOOLS_ADMIN") - คุณไม่ได้รับอนุญาตให้เข้าดูหน้านี้ได้ (หน้า "OFBTOOLS_VIEW" หรือ "OFBTOOLS_ADMIN" ที่ต้องการ) - 你没有浏览这个页面的权限。(需要"OFBTOOLS_VIEW"或"OFBTOOLS_ADMIN") - You may create an Entity Vous pouvez créer une entité @@ -1765,13 +1748,13 @@ Scritti XML per tutti i dati in เขียน XML สำหรับข้อมูลทั้งหมดใน - - The exported documents will have a root tag of "<entity-engine-xml>" - Les documents exportés auront une balise de racine de "<entity-engine-xml>" - I documenti esportati avranno un root tag "<entity-engine-xml>" - Documentele exportate vor avea un root tag "<entity-engine-xml>" - การส่งเอกสารจะต้องใช้รูทแท็กของ "<entity-engine-xml>" - 导出的文档会有一个"<entity-engine-xml>"的根标签 + + This page can be used to export data from the database + Cette page peut être utilisée pour exporter des données depuis la base + Questa pagine può essere usata per esportare i dati dal database + Aceasta pagina poate fi folosita pentru exportarea datelor din database + หน้านี้ใช้การส่งออกข้อมูลจากฐานข้อมูล + 本页面用于从数据库导出数据 Wrote @@ -1834,13 +1817,13 @@ NOTA: Questi risultati delle prestazioni potrebbero variare in base ai differenti database, หมายเหตุ:การกระทำเหล่านี้อาจจะเป็นผลให้เกิดการซื้อขายที่ดีสำหรับความแตกต่าง - - There will be one file for each Entity in the configured delegator for this webapp - Il y aura un dossier pour chaque entité dans le delegator configuré pour cette webapp - C'è un file per ogni Entità nel delegator configurato per questa applicazione web - Exista un file pentru orice Entitate din delegatorul configurat pentru aceasta aplicatie web. - มี 1 ไฟล์สำหรับตัวอย่าง Entity ในการสร้างตัวแทนสำหรับโปรแกรมประยุกต์นี้ - 在为这个应用配置的代表中,会对每个实体有一个文件。 + + The exported documents will have a root tag of "<entity-engine-xml>" + Les documents exportés auront une balise de racine de "<entity-engine-xml>" + I documenti esportati avranno un root tag "<entity-engine-xml>" + Documentele exportate vor avea un root tag "<entity-engine-xml>" + การส่งเอกสารจะต้องใช้รูทแท็กของ "<entity-engine-xml>" + 导出的文档会有一个"<entity-engine-xml>"的根标签 databases, JDBC drivers, JTA implementations (transaction managers), connection pools, @@ -1862,6 +1845,14 @@ server hardware, connessioni di rete). server ฮาร์ดแวร์,เชื่อมโยงเครือข่าย). + + There will be one file for each Entity in the configured delegator for this webapp + Il y aura un dossier pour chaque entité dans le delegator configuré pour cette webapp + C'è un file per ogni Entità nel delegator configurato per questa applicazione web + Exista un file pentru orice Entitate din delegatorul configurat pentru aceasta aplicatie web. + มี 1 ไฟล์สำหรับตัวอย่าง Entity ในการสร้างตัวแทนสำหรับโปรแกรมประยุกต์นี้ + 在为这个应用配置的代表中,会对每个实体有一个文件。 + Complete XML document (root tag: entity-engine-xml) Compléter le document XML (balise racine : entity-engine-xml)( @@ -2306,12 +2297,6 @@ Pop up หน้าหลักเครื่องมือพัฒนาเว็บ 弹出Web工具首页 - - Pre-configured set - Ensemble pré-configuré - Impostazioni Pre-configurate - ตั้งค่าก่อนการสร้าง - Catalog Export Exporter le catalogue @@ -2342,6 +2327,12 @@ Prodotti Parte 4 สินค้าส่วนที่ 4 + + Pre-configured set + Ensemble pré-configuré + Impostazioni Pre-configurate + ตั้งค่าก่อนการสร้าง + Dringlichkeit Priority @@ -3076,14 +3067,6 @@ การเลือกระดับในการกำหนดเวลาที่เหมาะสมที่สุดโดยข้อมูลจำนวนมากผลลัพธ์ที่ได้จะใช้แก้ไขข้อผิดพลาดของแอพพลิเคชั่น Timing(定时)级别会细颗粒地指出应用程序进行情况的信息,适于调试程序。 - - Title - Titre - Titolo - Titlu - หัวเรื่อง - 标题 - The purpose of this Web Tools administration package is to contain all of the Le but de cet d'ensemble d'outils Web d'administration est de contenir tout les outils @@ -3132,6 +3115,14 @@ ความพึงพอใจและความรู้ความสามารถในการจัดการ วิเคราะห์ข้อมูล พัฒนาไปข้างหน้าอย่างเต็มที่ 内容和知识管理、数据分析等。 + + Title + Titre + Titolo + Titlu + หัวเรื่อง + 标题 + To find ALL of Entity Pour trouver TOUT sur l'entité @@ -3245,6 +3236,15 @@ ดูข้อมูลการจดบันทึก 浏览日志 + + You do not have permission to view this page. ("OFBTOOLS_VIEW" or "OFBTOOLS_ADMIN" needed) + Vous n'avez pas l'autorisation de voir cette page ("OFBTOOLS_VIEW" ou "OFBTOOLS_ADMIN" nécessaire) + Non sei autorizzato a vedere questa pagina. (Necessario permesso "OFBTOOLS_VIEW" o "OFBTOOLS_ADMIN") + Nu esti autorizat sa vezi aceasta pagina. (Este necesar Permisul "OFBTOOLS_VIEW" sau "OFBTOOLS_ADMIN") + У вас нет прав для просмотра этой страницы. (необходимы права "OFBTOOLS_VIEW" или "OFBTOOLS_ADMIN") + คุณไม่ได้รับอนุญาตให้เข้าดูหน้านี้ได้ (หน้า "OFBTOOLS_VIEW" หรือ "OFBTOOLS_ADMIN" ที่ต้องการ) + 你没有浏览这个页面的权限。(需要"OFBTOOLS_VIEW"或"OFBTOOLS_ADMIN") + View Relations Voir les relations diff --git a/framework/webtools/servicedef/services.xml b/framework/webtools/servicedef/services.xml index abd0d1fa5f..6afcb20615 100644 --- a/framework/webtools/servicedef/services.xml +++ b/framework/webtools/servicedef/services.xml @@ -132,11 +132,13 @@ under the License. invoke="updateLabelKey" auth="true" use-transaction="false"> Update Label Key + + diff --git a/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelInfo.java b/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelInfo.java index 797646e322..4c01979f49 100644 --- a/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelInfo.java +++ b/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelInfo.java @@ -31,21 +31,31 @@ public class LabelInfo { public static final String module = LabelInfo.class.getName(); protected String labelKey = ""; + protected String labelKeyComment = ""; protected String fileName = ""; - protected String componentName = ""; - protected Map labelValues = FastMap.newInstance(); + protected String componentName = ""; + protected Map labelValues = FastMap.newInstance(); - public LabelInfo(String labelKey, String fileName, String componentName, String localeStr, String labelValue) throws GeneralException { + public LabelInfo(String labelKey, String labelKeyComment, String fileName, String componentName, String localeStr, String labelValue, String labelComment) throws GeneralException { this.labelKey = labelKey; + this.labelKeyComment = labelKeyComment; this.fileName = fileName; this.componentName = componentName; - setLabelValue(localeStr, labelValue, false); + setLabelValue(localeStr, labelValue, labelComment, false); } public String getLabelKey() { return labelKey; } + public String getLabelKeyComment() { + return labelKeyComment; + } + + public void setLabelKeyComment(String labelKeyComment) { + this.labelKeyComment = labelKeyComment; + } + public String getFileName() { return fileName; } @@ -54,26 +64,29 @@ public class LabelInfo { return componentName; } - public String getLabelValue(String localeStr) { - return (String)labelValues.get(localeStr); + public LabelValue getLabelValue(String localeStr) { + return (LabelValue)labelValues.get(localeStr); } public int getLabelValueSize() { return labelValues.size(); } - public boolean setLabelValue(String localeStr, String labelValue, boolean update) { - String localeFound = getLabelValue(localeStr); + public boolean setLabelValue(String localeStr, String labelValue, String labelComment, boolean update) { + LabelValue localeFound = getLabelValue(localeStr); boolean isDuplicatedLocales = false; if (UtilValidate.isEmpty(localeFound)) { if (UtilValidate.isNotEmpty(labelValue)) { - labelValues.put(localeStr, labelValue); + localeFound = new LabelValue(labelValue, labelComment); + labelValues.put(localeStr, localeFound); } } else { if (update) { if (UtilValidate.isNotEmpty(labelValue)) { - labelValues.put(localeStr, labelValue); + localeFound.setLabelValue(labelValue); + localeFound.setLabelComment(labelComment); + labelValues.put(localeStr, localeFound); } else { labelValues.remove(localeStr); } diff --git a/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelManagerFactory.java b/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelManagerFactory.java index c142676846..4c080864a4 100644 --- a/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelManagerFactory.java +++ b/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelManagerFactory.java @@ -31,6 +31,7 @@ import java.util.TreeSet; import org.ofbiz.base.component.ComponentConfig; import org.ofbiz.base.util.FileUtil; import org.ofbiz.base.util.GeneralException; +import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilProperties; @@ -41,8 +42,10 @@ import org.ofbiz.base.util.cache.UtilCache; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.ServiceUtil; +import org.w3c.dom.Comment; import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Node; public class LabelManagerFactory { @@ -101,27 +104,41 @@ public class LabelManagerFactory { String fileName = resourceFile.getName(); Document resourceDocument = UtilXml.readXmlDocument(resourceFile.toURI().toURL()); Element resourceElem = resourceDocument.getDocumentElement(); + String labelKeyComment = ""; - for (Element propertyElem: UtilXml.childElementList(resourceElem, "property")) { - String labelKey = propertyElem.getAttribute("key"); - - for (Element valueElem: UtilXml.childElementList(propertyElem, "value")) { - String localeName = valueElem.getAttribute("xml:lang"); - String labelValue = UtilXml.elementValue(valueElem); - LabelInfo label = (LabelInfo)labels.get(labelKey + keySeparator + fileName); + for (Node propertyNode: UtilXml.childNodeList(resourceElem.getFirstChild())) { + if (propertyNode instanceof Element) { + Element propertyElem = (Element)propertyNode; + String labelKey = StringUtil.htmlSpecialChars(propertyElem.getAttribute("key"), true, true, false); + String labelComment = ""; - if (UtilValidate.isEmpty(label)) { - label = new LabelInfo(labelKey, fileName, componentName, localeName, labelValue); - labels.put(labelKey + keySeparator + fileName, label); - } else { - if (label.setLabelValue(localeName, labelValue, false)) { - duplicatedLocales++; + for (Node valueNode: UtilXml.childNodeList(propertyElem.getFirstChild())) { + if (valueNode instanceof Element) { + Element valueElem = (Element)valueNode; + String localeName = valueElem.getAttribute("xml:lang"); + String labelValue = StringUtil.htmlSpecialChars(UtilXml.nodeValue(valueElem.getFirstChild()), true, true, false); + LabelInfo label = (LabelInfo)labels.get(labelKey + keySeparator + fileName); + + if (UtilValidate.isEmpty(label)) { + label = new LabelInfo(labelKey, labelKeyComment, fileName, componentName, localeName, labelValue, labelComment); + labels.put(labelKey + keySeparator + fileName, label); + } else { + if (label.setLabelValue(localeName, labelValue, labelComment, false)) { + duplicatedLocales++; + } + } + localesFound.add(localeName); + componentNamesFound.add(componentName); + fileNamesFound.put(fileName, resourceFile.toURI().toString()); + fileComponent.put(fileName, componentName); + labelComment = ""; + } else if (valueNode instanceof Comment) { + labelComment = labelComment + StringUtil.htmlSpecialChars(valueNode.getNodeValue(), true, true, false); } - } - localesFound.add(localeName); - componentNamesFound.add(componentName); - fileNamesFound.put(fileName, resourceFile.toURI().toString()); - fileComponent.put(fileName, componentName); + } + labelKeyComment = ""; + } else if (propertyNode instanceof Comment) { + labelKeyComment = labelKeyComment + StringUtil.htmlSpecialChars(propertyNode.getNodeValue(), true, true, false); } } } @@ -168,12 +185,14 @@ public class LabelManagerFactory { public static Map updateLabelKey(DispatchContext dctx, Map context) { String key = (String)context.get("key"); + String keyComment = (String)context.get("keyComment"); String update_label = (String)context.get("update_label"); String fileName = (String)context.get("fileName"); String confirm = (String)context.get("confirm"); String removeLabel = (String)context.get("removeLabel"); List localeNames = UtilGenerics.cast(context.get("localeNames")); List localeValues = UtilGenerics.cast(context.get("localeValues")); + List localeComments = UtilGenerics.cast(context.get("localeComments")); Locale locale = (Locale) context.get("locale"); // Remove a Label @@ -185,7 +204,7 @@ public class LabelManagerFactory { // Update a Label if (update_label.equalsIgnoreCase("Y")) { if (UtilValidate.isNotEmpty(label)) { - updateLabelValue(localeNames, localeValues, label, key, fileName); + updateLabelValue(localeNames, localeValues, localeComments, label, key, keyComment, fileName); } // Insert a new Label } else { @@ -195,7 +214,7 @@ public class LabelManagerFactory { if (UtilValidate.isEmpty(key)) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "WebtoolsLabelManagerNewLabelEmptyKey", locale)); } else { - int notEmptyLabels = updateLabelValue(localeNames, localeValues, null, key, fileName); + int notEmptyLabels = updateLabelValue(localeNames, localeValues, localeComments, null, key, keyComment, fileName); if (notEmptyLabels == 0) { return ServiceUtil.returnError(UtilProperties.getMessage(resource, "WebtoolsLabelManagerNewLabelEmpty", locale)); } @@ -207,24 +226,27 @@ public class LabelManagerFactory { return ServiceUtil.returnSuccess(); } - private static int updateLabelValue(List localeNames, List localeValues, LabelInfo label, String key, String fileName) { + private static int updateLabelValue(List localeNames, List localeValues, List localeComments, LabelInfo label, String key, String keyComment, String fileName) { int notEmptyLabels = 0; int i = 0; while (i < localeNames.size()) { String localeName = (String)localeNames.get(i); String localeValue = (String)localeValues.get(i); + String localeComment = (String)localeComments.get(i); - if (UtilValidate.isNotEmpty(localeValue)) { + if (UtilValidate.isNotEmpty(localeValue) || UtilValidate.isNotEmpty(localeComment)) { if (label == null) { try { String componentName = getFileComponent(fileName); - label = new LabelInfo(key, fileName, componentName, localeName, localeValue); + label = new LabelInfo(key, keyComment, fileName, componentName, localeName, localeValue, localeComment); labels.put(key + keySeparator + fileName, label); } catch(Exception e) { e.printStackTrace(); } + } else { + label.setLabelKeyComment(keyComment); } - label.setLabelValue(localeName, localeValue, true); + label.setLabelValue(localeName, localeValue, localeComment, true); notEmptyLabels++; } i++; diff --git a/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelValue.java b/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelValue.java new file mode 100644 index 0000000000..70aea80944 --- /dev/null +++ b/framework/webtools/src/org/ofbiz/webtools/labelmanager/LabelValue.java @@ -0,0 +1,48 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.ofbiz.webtools.labelmanager; + +public class LabelValue { + + public static final String module = LabelValue.class.getName(); + + protected String labelValue = ""; + protected String labelComment = ""; + + public LabelValue(String labelValue, String labelComment) { + this.labelValue = labelValue; + this.labelComment = labelComment; + } + + public String getLabelValue() { + return labelValue; + } + + public String getLabelComment() { + return labelComment; + } + + public void setLabelValue(String labelValue) { + this.labelValue = labelValue; + } + + public void setLabelComment(String labelComment) { + this.labelComment = labelComment; + } +} diff --git a/framework/webtools/src/org/ofbiz/webtools/labelmanager/SaveLabelsToXmlFile.java b/framework/webtools/src/org/ofbiz/webtools/labelmanager/SaveLabelsToXmlFile.java index a4646c48c2..0fad6fd43b 100644 --- a/framework/webtools/src/org/ofbiz/webtools/labelmanager/SaveLabelsToXmlFile.java +++ b/framework/webtools/src/org/ofbiz/webtools/labelmanager/SaveLabelsToXmlFile.java @@ -27,104 +27,119 @@ import java.util.Set; import org.apache.xml.serialize.OutputFormat; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.FileUtil; +import org.ofbiz.base.util.StringUtil; import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.base.util.UtilXml; import org.ofbiz.base.util.cache.UtilCache; -import org.ofbiz.base.util.FileUtil; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.ServiceUtil; +import org.w3c.dom.Comment; import org.w3c.dom.Document; import org.w3c.dom.Element; +import org.w3c.dom.Node; public class SaveLabelsToXmlFile { - private static final String resource = "WebtoolsUiLabels"; - private static final String module = SaveLabelsToXmlFile.class.getName(); + private static final String resource = "WebtoolsUiLabels"; + private static final String module = SaveLabelsToXmlFile.class.getName(); - public static Map saveLabelsToXmlFile(DispatchContext dctx, Map context) { - Locale locale = (Locale)context.get("locale"); - String labelFileName = (String)context.get("labelFileName"); + public static Map saveLabelsToXmlFile(DispatchContext dctx, Map context) { + Locale locale = (Locale)context.get("locale"); + String labelFileName = (String)context.get("labelFileName"); - try { - LabelManagerFactory.getLabelManagerFactory(dctx.getDelegator().getDelegatorName()); - Map labels = LabelManagerFactory.getLabels(); - Map fileNamesFound = LabelManagerFactory.getFileNamesFound(); - Set labelsList = LabelManagerFactory.getLabelsList(); - Set localesFound = LabelManagerFactory.getLocalesFound(); + try { + LabelManagerFactory.getLabelManagerFactory(dctx.getDelegator().getDelegatorName()); + Map labels = LabelManagerFactory.getLabels(); + Map fileNamesFound = LabelManagerFactory.getFileNamesFound(); + Set labelsList = LabelManagerFactory.getLabelsList(); + Set localesFound = LabelManagerFactory.getLocalesFound(); - for (String fileName : fileNamesFound.keySet()) { - if (UtilValidate.isNotEmpty(labelFileName) && !(labelFileName.equalsIgnoreCase(fileName))) { - continue; - } + for (String fileName : fileNamesFound.keySet()) { + if (UtilValidate.isNotEmpty(labelFileName) && !(labelFileName.equalsIgnoreCase(fileName))) { + continue; + } - String uri = (String)fileNamesFound.get(fileName); - Document resourceDocument = UtilXml.makeEmptyXmlDocument("resource"); - Element resourceElem = resourceDocument.getDocumentElement(); - resourceElem.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); + String uri = (String)fileNamesFound.get(fileName); + Document resourceDocument = UtilXml.makeEmptyXmlDocument("resource"); + Element resourceElem = resourceDocument.getDocumentElement(); + resourceElem.setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); - for (String labelKey : labelsList) { - LabelInfo labelInfo = (LabelInfo)labels.get(labelKey); + for (String labelKey : labelsList) { + LabelInfo labelInfo = (LabelInfo)labels.get(labelKey); - if (!(labelInfo.getFileName().equalsIgnoreCase(fileName))) { - continue; - } + if (!(labelInfo.getFileName().equalsIgnoreCase(fileName))) { + continue; + } - Element propertyElem = UtilXml.addChildElement(resourceElem, "property", resourceDocument); - propertyElem.setAttribute("key", labelInfo.getLabelKey()); - - for (String localeFound : localesFound) { - String labelValue = labelInfo.getLabelValue(localeFound); - - if (UtilValidate.isNotEmpty(labelValue)) { - Element valueElem = UtilXml.addChildElementValue(propertyElem, "value", labelValue, resourceDocument); - valueElem.setAttribute("xml:lang", localeFound); - } - } - } - - if (UtilValidate.isNotEmpty(resourceElem) && UtilValidate.isNotEmpty(uri)) { - File outFile = new File(new URI(uri)); - FileOutputStream fos = new FileOutputStream(outFile); - OutputFormat format = new OutputFormat(resourceDocument.getDocumentElement().getOwnerDocument(), "UTF-8", true); + Element propertyElem = UtilXml.addChildElement(resourceElem, "property", resourceDocument); + propertyElem.setAttribute("key", StringUtil.fromHtmlToSpecialChars(labelInfo.getLabelKey(), true, true, false)); - try { - format.setIndent(4); - format.setOmitXMLDeclaration(true); - UtilXml.writeXmlDocument(fos, resourceElem, format); - } finally { - if (UtilValidate.isNotEmpty(fos)) { - fos.close(); + if (UtilValidate.isNotEmpty(labelInfo.getLabelKeyComment())) { + Comment labelKeyComment = resourceDocument.createComment(StringUtil.fromHtmlToSpecialChars(labelInfo.getLabelKeyComment(), true, true, false)); + Node parent = propertyElem.getParentNode(); + parent.insertBefore(labelKeyComment, propertyElem); + } + + for (String localeFound : localesFound) { + LabelValue labelValue = labelInfo.getLabelValue(localeFound); + + if (UtilValidate.isNotEmpty(labelValue)) { + Element valueElem = UtilXml.addChildElementValue(propertyElem, "value", StringUtil.fromHtmlToSpecialChars(labelValue.getLabelValue(), true, true, false), resourceDocument); + valueElem.setAttribute("xml:lang", localeFound); + + if (UtilValidate.isNotEmpty(labelValue.getLabelComment())) { + Comment labelComment = resourceDocument.createComment(StringUtil.fromHtmlToSpecialChars(labelValue.getLabelComment(), true, true, false)); + Node parent = valueElem.getParentNode(); + parent.insertBefore(labelComment, valueElem); + } + } + } + } + + if (UtilValidate.isNotEmpty(resourceElem) && UtilValidate.isNotEmpty(uri)) { + File outFile = new File(new URI(uri)); + FileOutputStream fos = new FileOutputStream(outFile); + OutputFormat format = new OutputFormat(resourceDocument.getDocumentElement().getOwnerDocument(), "UTF-8", true); + + try { + format.setIndent(4); + format.setOmitXMLDeclaration(true); + UtilXml.writeXmlDocument(fos, resourceElem, format); + } finally { + if (UtilValidate.isNotEmpty(fos)) { + fos.close(); - // workaround to insert the Apache License Header at top of the file - // because the comment on top the xml file has been not written - String outBuffer = FileUtil.readString("UTF-8", outFile); - String basePath = System.getProperty("ofbiz.home"); + // workaround to insert the Apache License Header at top of the file + // because the comment on top the xml file has been not written + String outBuffer = FileUtil.readString("UTF-8", outFile); + String basePath = System.getProperty("ofbiz.home"); - if (UtilValidate.isNotEmpty(basePath)) { - String apacheHeaderFileName = basePath + "/framework/webtools/config/APACHE2_HEADER_FOR_XML"; - String apacheHeaderBuffer = ""; - File apacheHeaderFile = new File(apacheHeaderFileName); + if (UtilValidate.isNotEmpty(basePath)) { + String apacheHeaderFileName = basePath + "/framework/webtools/config/APACHE2_HEADER_FOR_XML"; + String apacheHeaderBuffer = ""; + File apacheHeaderFile = new File(apacheHeaderFileName); - if (UtilValidate.isNotEmpty(apacheHeaderFile)) { - apacheHeaderBuffer = FileUtil.readString("UTF-8", apacheHeaderFile); - } + if (UtilValidate.isNotEmpty(apacheHeaderFile)) { + apacheHeaderBuffer = FileUtil.readString("UTF-8", apacheHeaderFile); + } - FileUtil.writeString("UTF-8", apacheHeaderBuffer + outBuffer, outFile); + FileUtil.writeString("UTF-8", apacheHeaderBuffer + outBuffer, outFile); - // clear cache to see immediately the new labels and translations in OFBiz - UtilCache.clearCache("properties.UtilPropertiesBundleCache"); - } - } - } - } - } - } catch (Exception e) { - Debug.logError(e, "Exception during save labels to xml file:", module); - return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "saveLabelsToXmlFile.exceptionDuringSaveLabelsToXmlFile", locale)); - } - return ServiceUtil.returnSuccess(); - } + // clear cache to see immediately the new labels and translations in OFBiz + UtilCache.clearCache("properties.UtilPropertiesBundleCache"); + } + } + } + } + } + } catch (Exception e) { + Debug.logError(e, "Exception during save labels to xml file:", module); + return ServiceUtil.returnFailure(UtilProperties.getMessage(resource, "saveLabelsToXmlFile.exceptionDuringSaveLabelsToXmlFile", locale)); + } + return ServiceUtil.returnSuccess(); + } } diff --git a/framework/webtools/webapp/webtools/labelmanager/UpdateLabel.ftl b/framework/webtools/webapp/webtools/labelmanager/UpdateLabel.ftl index 20fc6521f2..bbbb475d61 100644 --- a/framework/webtools/webapp/webtools/labelmanager/UpdateLabel.ftl +++ b/framework/webtools/webapp/webtools/labelmanager/UpdateLabel.ftl @@ -30,11 +30,17 @@ under the License. <#else> - + + + ${uiLabelMap.WebtoolsLabelManagerKeyComment} + + + + ${uiLabelMap.WebtoolsLabelManagerFileName} @@ -63,10 +69,14 @@ under the License. <#list localesFound as localeFound> + <#assign labelValue = ""> + <#assign labelComment = ""> <#if parameters.sourceKey?exists> - <#assign labelVal = (label.getLabelValue(localeFound))?if_exists> - <#else> - <#assign labelVal = ""> + <#assign value = (label.getLabelValue(localeFound))?if_exists> + <#if value?has_content> + <#assign labelValue = value.getLabelValue()> + <#assign labelComment = value.getLabelComment()> + <#assign showLocale = true> <#if parameters.labelLocaleName?exists && parameters.labelLocaleName != "" && parameters.labelLocaleName != localeFound> @@ -89,7 +99,8 @@ under the License. - + + diff --git a/framework/webtools/webapp/webtools/labelmanager/ViewLabels.ftl b/framework/webtools/webapp/webtools/labelmanager/ViewLabels.ftl index 2ee3f3eaeb..b6f140c016 100644 --- a/framework/webtools/webapp/webtools/labelmanager/ViewLabels.ftl +++ b/framework/webtools/webapp/webtools/labelmanager/ViewLabels.ftl @@ -64,7 +64,7 @@ under the License. <#if showLabel == true> class="alternate-row"> - class="submenutext">${label.labelKey} + class="submenutext">${label.labelKey} ${label.fileName} <#list localesFound as localeFound> <#assign labelVal = label.getLabelValue(localeFound)?if_exists> @@ -74,7 +74,7 @@ under the License. <#if showLocale == true> <#if labelVal?has_content> - ${labelVal} + ${labelVal.getLabelValue()} <#else>   diff --git a/specialpurpose/myportal/config/MyPortalUiLabels.xml b/specialpurpose/myportal/config/MyPortalUiLabels.xml index e88832ce4b..ddf71b84cc 100644 --- a/specialpurpose/myportal/config/MyPortalUiLabels.xml +++ b/specialpurpose/myportal/config/MyPortalUiLabels.xml @@ -1,5 +1,6 @@