ページ「モジュール:Citation/CS-ja」と「モジュール:Citation/CS-ja/sandbox」の間の差分
(ページ間の差分)
削除された内容 追加された内容
|ref=省略時にアンカーを生成しない不具合を修正 |
スクリプトエラーを回避 |
||
2,266行目: | 2,266行目: | ||
local function format_volume_issue (volume, issue, article, cite_class, origin, sepc, lower, volume_title) |
local function format_volume_issue (volume, issue, article, cite_class, origin, sepc, lower, volume_title) |
||
-- |
-- CS-ja独自処理 |
||
if utilities.is_set (volume_title) then |
if utilities.is_set (volume_title) then |
||
volume_title = '《' .. volume_title .. '》'; |
volume_title = '《' .. volume_title .. '》'; |
||
2,272行目: | 2,272行目: | ||
if not utilities.is_set (volume) and not utilities.is_set (issue) and not utilities.is_set (article) then |
if not utilities.is_set (volume) and not utilities.is_set (issue) and not utilities.is_set (article) then |
||
-- |
-- CS-ja独自処理 |
||
if utilities.is_set (volume_title) then |
if utilities.is_set (volume_title) then |
||
return volume_title; |
return volume_title; |
||
2,304行目: | 2,304行目: | ||
vol = vol .. (utilities.is_set (issue) and utilities.substitute (cfg.messages['j-issue'], issue) or '') |
vol = vol .. (utilities.is_set (issue) and utilities.substitute (cfg.messages['j-issue'], issue) or '') |
||
vol = vol .. (utilities.is_set (article) and utilities.substitute (cfg.messages['j-article-num'], article) or '') |
vol = vol .. (utilities.is_set (article) and utilities.substitute (cfg.messages['j-article-num'], article) or '') |
||
-- CS-ja独自処理 |
|||
if utilities.is_set (volume_title) then |
|||
utilities.set_message ('err_volume_title_ignored'); -- エラーカテゴリを付与する |
|||
⚫ | |||
return vol; |
return vol; |
||
end |
end |
||
2,312行目: | 2,318行目: | ||
if 'conference' == cite_class and utilities.is_set (article) then -- |article-number= supported only in journal and conference cites |
if 'conference' == cite_class and utilities.is_set (article) then -- |article-number= supported only in journal and conference cites |
||
-- CS-ja独自処理 |
|||
if utilities.is_set (volume_title) then |
|||
utilities.set_message ('err_volume_title_ignored'); -- エラーカテゴリを付与する |
|||
⚫ | |||
if utilities.is_set (volume) and utilities.is_set (article) then -- both volume and article number |
if utilities.is_set (volume) and utilities.is_set (article) then -- both volume and article number |
||
return wrap_msg ('vol-art', {sepc, utilities.hyphen_to_dash (volume), article}, lower); |
return wrap_msg ('vol-art', {sepc, utilities.hyphen_to_dash (volume), article}, lower); |
||
2,328行目: | 2,340行目: | ||
end |
end |
||
if utilities.is_set (volume) and utilities.is_set (issue) then |
if utilities.is_set (volume) and utilities.is_set (issue) then |
||
-- CS-ja独自処理 |
|||
if utilities.is_set (volume_title) then |
|||
utilities.set_message ('err_volume_title_ignored'); -- エラーカテゴリを付与する |
|||
⚫ | |||
return wrap_msg ('vol-no', {sepc, vol, issue}, lower); |
return wrap_msg ('vol-no', {sepc, vol, issue}, lower); |
||
elseif utilities.is_set (volume) then |
elseif utilities.is_set (volume) then |
||
-- |
-- CS-ja独自処理 |
||
if utilities.is_set (volume_title) then |
if utilities.is_set (volume_title) then |
||
vol = vol .. volume_title; |
vol = vol .. volume_title; |
||
2,646行目: | 2,664行目: | ||
elseif 3 == selected then |
elseif 3 == selected then |
||
Authors = A['Authors']; -- use content of |authors= |
Authors = A['Authors']; -- use content of |authors= |
||
--if 'authors' == A:ORIGIN('Authors') then -- but add a maint cat if the parameter is |authors= |
|||
-- utilities.set_message ('maint_authors'); -- because use of this parameter is discouraged; what to do about the aliases is a TODO: |
|||
⚫ | |||
end |
end |
||
if utilities.is_set (Collaboration) then |
if utilities.is_set (Collaboration) then |
||
3,181行目: | 3,196行目: | ||
local y, suffix = mw.ustring.match(Date, '^(%d%d%d%d?)([a-zA-Z年]?)$'); |
local y, suffix = mw.ustring.match(Date, '^(%d%d%d%d?)([a-zA-Z年]?)$'); |
||
if utilities.is_set (y) then |
if utilities.is_set (y) then |
||
if |
if suffix:match('^[a-zA-Z]$') then -- Dateの末尾にアルファベットの接尾辞があれば |
||
Year = Date; -- Dateを上書きする前に、Yearにコピーする |
Year = Date; -- Dateを上書きする前に、Yearにコピーする |
||
end |
end |
||
3,199行目: | 3,214行目: | ||
]] |
]] |
||
local DF = is_valid_parameter_value (A['DF'], A:ORIGIN('DF'), cfg.keywords_lists['df'], 'ja'); |
local DF = is_valid_parameter_value (A['DF'], A:ORIGIN('DF'), cfg.keywords_lists['df'], 'ja'); -- CS-ja独自仕様: |df=の指定がなければja形式で表示する |
||
if not utilities.is_set (DF) then |
--if not utilities.is_set (DF) then |
||
-- DF = cfg.global_df; -- local |df= if present overrides global df set by {{use xxx date}} template |
|||
end |
--end |
||
local ArchiveURL; |
local ArchiveURL; |
||
3,250行目: | 3,265行目: | ||
if 0 == #error_list then -- error free dates only; 0 when error_list is empty |
if 0 == #error_list then -- error free dates only; 0 when error_list is empty |
||
local modified = false; -- flag |
local modified = false; -- flag |
||
⚫ | |||
⚫ | |||
else -- 日本語版独自:常に日付の書式を整える |
|||
modified = validation.reformat_dates (date_parameters_list, ''); |
|||
⚫ | |||
if true == validation.date_hyphen_to_dash (date_parameters_list) then -- convert hyphens to dashes where appropriate |
if true == validation.date_hyphen_to_dash (date_parameters_list) then -- convert hyphens to dashes where appropriate |
||
modified = true; |
modified = true; |
||
utilities.set_message ('maint_date_format'); -- hyphens were converted so add maint category |
utilities.set_message ('maint_date_format'); -- hyphens were converted so add maint category |
||
end |
|||
⚫ | |||
⚫ | |||
end |
end |
||
3,312行目: | 3,325行目: | ||
} |
} |
||
-- CS-ja独自: asin_tld省略時にCS1と異なる動作をさせるため、第2引数のテーブルにCS_jaフィールドを追加する |
|||
ID_list, ID_list_coins = identifiers.identifier_lists_get (args, {DoiBroken = DoiBroken, ASINTLD = A['ASINTLD'], Embargo = Embargo, Class = Class}, ID_support); |
ID_list, ID_list_coins = identifiers.identifier_lists_get (args, {DoiBroken = DoiBroken, ASINTLD = A['ASINTLD'], Embargo = Embargo, Class = Class, CS_ja = true}, ID_support); |
||
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite medrxiv}}, {{cite ssrn}}, before generation of COinS data. |
-- Account for the oddities that are {{cite arxiv}}, {{cite biorxiv}}, {{cite citeseerx}}, {{cite medrxiv}}, {{cite ssrn}}, before generation of COinS data. |
||
4,275行目: | 4,289行目: | ||
end |
end |
||
options_t.id = Ref or citeref_id; |
options_t.id = Ref or citeref_id; |
||
-- 日本語版独自処理: |date=や|year=に「YYYY年」形式の日付を指定していた場合に、 |
|||
-- 自動生成するidにも「年」が含まれるバグが存在した。 |
|||
-- このバグを修正することでアンカーのリンク切れが生じる可能性があるため、 |
|||
-- 調査が終わるまではプロパティカテゴリで追跡するようにする。 |
|||
if (not Ref) and utilities.is_set (citeref_id) then |
|||
if mw.ustring.match(first_set ({A['Date'], A['Year']}, 2) or '', '%d%d%d%d?年$') then |
|||
utilities.add_prop_cat ('year-ja'); |
|||
end |
|||
end |
|||
end |
end |
||
4,347行目: | 4,371行目: | ||
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v)); |
table.insert (render_t, utilities.substitute (cfg.messages['cat wikilink'], v)); |
||
end |
end |
||
⚫ | |||
-- 日本語版独自:properties categoryを導入しない |
|||
⚫ | |||
⚫ | |||
end |
|||
⚫ | |||
⚫ | |||
end |
end |
||