Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
c63229e5
提交
c63229e5
authored
12月 02, 2016
作者:
Sergey Safarov
提交者:
Mike Jerris
12月 30, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
FS-9805: Created script to compare XML traslation files with phrase_en.xml
上级
174a1e24
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
82 行增加
和
0 行删除
+82
-0
README.TXT
docs/phrase/README.TXT
+5
-0
make_checks.sh
docs/phrase/make_checks.sh
+17
-0
make_checks.xslt
docs/phrase/make_checks.xslt
+60
-0
没有找到文件。
docs/phrase/README.TXT
浏览文件 @
c63229e5
...
@@ -7,6 +7,11 @@ to automatically generate or verify all the files exist for a particular
...
@@ -7,6 +7,11 @@ to automatically generate or verify all the files exist for a particular
language. If you are capable of recording each language please do so and
language. If you are capable of recording each language please do so and
contribute them to the project. As phrases are added, the files will need to be
contribute them to the project. As phrases are added, the files will need to be
updated for the respective phrase_xx.xml file.
updated for the respective phrase_xx.xml file.
make_checks.sh - script to compare phrase_en.xml with other language xml files.
Script output contans prompt elements with attributes:
translated - value 'false' or not displayed;
transpated-to - tranlation value if exists;
more-then-one-translation - displayed if exist two or more for given wav file.
How can you contribute?
How can you contribute?
...
...
docs/phrase/make_checks.sh
0 → 100755
浏览文件 @
c63229e5
#!/bin/sh
SAXON_JAR
=
/usr/share/java/saxon9he.jar
XML
=
$1
if
[
!
-f
"
$SAXON_JAR
"
]
;
then
echo
"Please update 'SAXON_JAR' varaiable value to location of SAXON jar"
exit
-1
fi
if
[
-z
"
$XML
"
]
;
then
echo
"Error: Please enter xml file name that must be ckecked."
echo
"Exmple: make_checks.sh phrase_es_ES.xml > comparison_result.xml"
exit
-1
fi
java
-jar
"
$SAXON_JAR
"
-xsl
:make_checks.xslt
-t
"
$XML
"
docs/phrase/make_checks.xslt
0 → 100644
浏览文件 @
c63229e5
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
xmlns:xs=
"http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes=
"xs"
version=
"2.0"
>
<xsl:template
match=
"/"
>
<xsl:variable
name=
"master_xml"
>
<xsl:copy-of
select=
"document('phrase_en.xml')/*"
/>
</xsl:variable>
<xsl:variable
name=
"current_xml"
>
<xsl:copy-of
select=
"*"
/>
</xsl:variable>
<xsl:apply-templates
select=
"$master_xml"
mode=
"checkElements"
>
<xsl:with-param
name=
"current_xml"
select=
"$current_xml/*"
/>
</xsl:apply-templates>
</xsl:template>
<xsl:template
match=
"en"
mode=
"checkElements"
>
<xsl:param
name=
"current_xml"
/>
<xsl:copy>
<xsl:attribute
name=
"translated-to"
select=
"name($current_xml)"
/>
<xsl:apply-templates
select=
"@*|node()"
mode=
"#current"
>
<xsl:with-param
name=
"current_xml"
select=
"$current_xml/*"
/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template
match=
"prompt"
mode=
"checkElements"
>
<xsl:param
name=
"current_xml"
/>
<xsl:variable
name=
"translation"
select=
"$current_xml[@filename=current()/@filename]/@phrase"
/>
<xsl:copy>
<xsl:apply-templates
select=
"@*"
mode=
"#current"
/>
<xsl:choose>
<xsl:when
test=
"count($translation)=0"
>
<xsl:attribute
name=
"translated"
select=
"false()"
/>
</xsl:when>
<xsl:when
test=
"@phrase = $translation"
>
<xsl:attribute
name=
"translated"
select=
"false()"
/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute
name=
"translated-to"
select=
"$translation[1]"
/>
</xsl:otherwise>
</xsl:choose>
<xsl:if
test=
"count($translation) > 1"
>
<xsl:attribute
name=
"more-then-one-translation"
select=
"true()"
/>
</xsl:if>
</xsl:copy>
</xsl:template>
<xsl:template
match=
"@*|node()"
mode=
"checkElements"
>
<xsl:param
name=
"current_xml"
/>
<xsl:copy>
<xsl:apply-templates
select=
"@*|node()"
mode=
"#current"
>
<xsl:with-param
name=
"current_xml"
select=
"$current_xml/*"
/>
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论