From 46ffe036a8e87e56e029700a75572f681f402458 Mon Sep 17 00:00:00 2001 From: Jun Yang Date: Fri, 2 Dec 2022 23:54:58 +0800 Subject: [PATCH] docs: zh-cn translation for replace_last, remove_last --- docs/source/_data/sidebar.yml | 2 ++ docs/source/filters/overview.md | 2 +- docs/source/zh-cn/filters/overview.md | 2 +- docs/source/zh-cn/filters/remove_last.md | 17 +++++++++++++++++ docs/source/zh-cn/filters/replace_last.md | 17 +++++++++++++++++ 5 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 docs/source/zh-cn/filters/remove_last.md create mode 100644 docs/source/zh-cn/filters/replace_last.md diff --git a/docs/source/_data/sidebar.yml b/docs/source/_data/sidebar.yml index 92d5b06af..99312b03c 100644 --- a/docs/source/_data/sidebar.yml +++ b/docs/source/_data/sidebar.yml @@ -54,8 +54,10 @@ filters: raw: raw.html remove: remove.html remove_first: remove_first.html + remove_last: remove_last.html replace: replace.html replace_first: replace_first.html + replace_last: replace_last.html reverse: reverse.html round: round.html rstrip: rstrip.html diff --git a/docs/source/filters/overview.md b/docs/source/filters/overview.md index 71bd82dca..51178b399 100644 --- a/docs/source/filters/overview.md +++ b/docs/source/filters/overview.md @@ -10,7 +10,7 @@ There's 40+ filters supported by LiquidJS. These filters can be categorized into Categories | Filters --- | --- Math | plus, minus, modulo, times, floor, ceil, round, divided_by, abs, at_least, at_most -String | append, prepend, capitalize, upcase, downcase, strip, lstrip, rstrip, strip_newlines, split, replace, replace_first, remove, remove_first, truncate, truncatewords +String | append, prepend, capitalize, upcase, downcase, strip, lstrip, rstrip, strip_newlines, split, replace, replace_first, replace_last,remove, remove_first, remove_last, truncate, truncatewords HTML/URI | escape, escape_once, url_encode, url_decode, strip_html, newline_to_br Array | slice, map, sort, sort_natural, uniq, where, first, last, join, reverse, concat, compact, size Date | date diff --git a/docs/source/zh-cn/filters/overview.md b/docs/source/zh-cn/filters/overview.md index 672796be9..0be713afd 100644 --- a/docs/source/zh-cn/filters/overview.md +++ b/docs/source/zh-cn/filters/overview.md @@ -10,7 +10,7 @@ LiquidJS 共支持 40+ 个过滤器,可以分为如下几类: 类别 | 过滤器 --- | --- 数学 | plus, minus, modulo, times, floor, ceil, round, divided_by, abs, at_least, at_most -字符串 | append, prepend, capitalize, upcase, downcase, strip, lstrip, rstrip, strip_newlines, split, replace, replace_first, remove, remove_first, truncate, truncatewords +字符串 | append, prepend, capitalize, upcase, downcase, strip, lstrip, rstrip, strip_newlines, split, replace, replace_first, replace_last, remove, remove_first, remove_last, truncate, truncatewords HTML/URI | escape, escape_once, url_encode, url_decode, strip_html, newline_to_br 数组 | slice, map, sort, sort_natural, uniq, wheres, first, last, join, reverse, concat, compact, size 日期 | date diff --git a/docs/source/zh-cn/filters/remove_last.md b/docs/source/zh-cn/filters/remove_last.md new file mode 100644 index 000000000..f5afdb45d --- /dev/null +++ b/docs/source/zh-cn/filters/remove_last.md @@ -0,0 +1,17 @@ +--- +title: remove_last +--- + +{% since %}v10.2.0{% endsince %} + +移除字符串中出现的最后一个指定子字符串。 + +输入 +```liquid +{{ "I strained to see the train through the rain" | remove_last: "rain" }} +``` + +输出 +```text +I strained to see the train through the +``` diff --git a/docs/source/zh-cn/filters/replace_last.md b/docs/source/zh-cn/filters/replace_last.md new file mode 100644 index 000000000..46736de7d --- /dev/null +++ b/docs/source/zh-cn/filters/replace_last.md @@ -0,0 +1,17 @@ +--- +title: replace_last +--- + +{% since %}v10.2.0{% endsince %} + +把字符串中出现的最后一个指定子字符串替换为另一个字符串。 + +输入 +```liquid +{{ "Take my protein pills and put my helmet on" | replace_last: "my", "your" }} +``` + +输出 +```text +Take my protein pills and put your helmet on +```