mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Back to CJK sanity II: re-introduce Japanese (CJK) [bug 4700]
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25511 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
612e52b093
commit
55a9aa7149
@ -53,6 +53,7 @@ interlingua interlingua "Interlingua" false iso8859-15 ia ""
|
||||
irish irish "Irish" false iso8859-15 ga_IE ""
|
||||
italian italian "Italian" false iso8859-15 it_IT ""
|
||||
japanese japanese "Japanese" false jis-plain ja_JP ""
|
||||
japanese-cjk "" "Japanese (CJK)" false euc-jp ja_JP ""
|
||||
kazakh kazakh "Kazakh" false pt154 kk_KZ ""
|
||||
# there is no country code for Korean because ko_KR is the same as ko_KI
|
||||
korean "" "Korean" false euc-kr ko ""
|
||||
|
@ -1080,6 +1080,24 @@ def revert_vietnamese(document):
|
||||
j = j + 1
|
||||
|
||||
|
||||
def convert_japanese_cjk(document):
|
||||
"Set language japanese to japanese-cjk"
|
||||
# Set document language from japanese-plain to japanese
|
||||
i = 0
|
||||
if document.language == "japanese":
|
||||
document.language = "japanese-cjk"
|
||||
i = find_token(document.header, "\\language", 0)
|
||||
if i != -1:
|
||||
document.header[i] = "\\language japanese-cjk"
|
||||
j = 0
|
||||
while True:
|
||||
j = find_token(document.body, "\\lang japanese", j)
|
||||
if j == -1:
|
||||
return
|
||||
document.body[j] = document.body[j].replace("\\lang japanese", "\\lang japanese-cjk")
|
||||
j = j + 1
|
||||
|
||||
|
||||
def revert_japanese(document):
|
||||
"Set language japanese-plain to japanese"
|
||||
# Set document language from japanese-plain to japanese
|
||||
@ -1098,6 +1116,24 @@ def revert_japanese(document):
|
||||
j = j + 1
|
||||
|
||||
|
||||
def revert_japanese_cjk(document):
|
||||
"Set language japanese-cjk to japanese"
|
||||
# Set document language from japanese-plain to japanese
|
||||
i = 0
|
||||
if document.language == "japanese-cjk":
|
||||
document.language = "japanese"
|
||||
i = find_token(document.header, "\\language", 0)
|
||||
if i != -1:
|
||||
document.header[i] = "\\language japanese"
|
||||
j = 0
|
||||
while True:
|
||||
j = find_token(document.body, "\\lang japanese-cjk", j)
|
||||
if j == -1:
|
||||
return
|
||||
document.body[j] = document.body[j].replace("\\lang japanese-cjk", "\\lang japanese")
|
||||
j = j + 1
|
||||
|
||||
|
||||
def revert_japanese_encoding(document):
|
||||
"Set input encoding form EUC-JP-plain to EUC-JP etc."
|
||||
# Set input encoding form EUC-JP-plain to EUC-JP etc.
|
||||
@ -2815,7 +2851,7 @@ convert = [[277, [fix_wrong_tables]],
|
||||
[289, [convert_latexcommand_index]],
|
||||
[290, []],
|
||||
[291, []],
|
||||
[292, []],
|
||||
[292, [convert_japanese_cjk]],
|
||||
[293, []],
|
||||
[294, [convert_pdf_options]],
|
||||
[295, [convert_htmlurl, convert_url]],
|
||||
@ -2910,7 +2946,7 @@ revert = [[337, [revert_polytonicgreek]],
|
||||
[294, [revert_href, revert_url]],
|
||||
[293, [revert_pdf_options_2]],
|
||||
[292, [revert_inset_info]],
|
||||
[291, [revert_japanese, revert_japanese_encoding]],
|
||||
[291, [revert_japanese, revert_japanese_encoding, revert_japanese_cjk]],
|
||||
[290, [revert_vietnamese]],
|
||||
[289, [revert_wraptable]],
|
||||
[288, [revert_latexcommand_index]],
|
||||
|
Loading…
Reference in New Issue
Block a user