Yuan Yijun (bbbush) wrote,
Yuan Yijun

LJ 高级定制

Edit Entry, Edit Tags, Add to Memories
Insert... Image
Default, Default, (default)
work as user: [[user]] switch
posted by: [[user]]
Entry is Backdated
(all mood text)

真有意思,有意思,看高级定制选项,原来 LJ 真的是世上最强啊!看来我得考虑延长付费期限了 :) 也许,应该学学 perl 是怎么做到这些的?

可以对 Core 进行 layout 和 lang 的定制,我当然不会对付 layout 那么难的东西了,所以只定制了 lang。然后,可以对某种 layout 的 theme, lang, user 定制,我也只定制了 lang,而 theme 和 user 是由管理定制的向导页面保存的。这里 是每类定制的范围,可以看到 lang 的定制对属性的定义、取值,以及函数的定义有效。如果有时间,倒真的可以把 layout 重做一个呢 :)

其实可以把这两份 lang 定制提交上去的

定制好的这几项内容都称为 layer,然后可以创建一份 style,也就是一个定制方案,其中包含一种 layout,最后把这些 layer 应用进去。太神奇了。也许保存&编译操作仅仅是解析这些 layer,替换重定义的内容,然后把最终结果保存起来?还好只有两层,不然查找属性定义都会把人累死。字符串都移动到 translate 框架就好了!另外,付费用户可以创建很多 layout,很多 layer,而免费用户只能为每种 layout 创建一份 style,并且只能通过定制向导定义 theme & user

1. Core 定制翻译

layerinfo "type" = "i18nc";
layerinfo "name" = "Chinese";
layerinfo "langcode" = "zh-cn";
set lang_current = "zh-cn";

# 属性名按照字典顺序排序
set lang_dayname_short = ["", "周日", "周一", "周二", "周三", "周四", "周五", "周六"];

set text_nosubject = "(没主题 :)";

set text_post_comment = "发表评论";
set text_post_comment_friends = "发表评论";

set text_permalink = "永久链接";

set text_read_comments = "阅读 # 评论";
set text_read_comments_friends = "阅读 # 评论";

set text_tags = "标签: #";

set text_view_archive = "文章存档";
set text_view_friends = "好友们";
set text_view_month = "当月文章";
set text_view_recent = "最近的文章";
set text_view_userinfo = "用户资料";

# One form (the number is inflected)
function lang_map_plural (int n) : int {
return 0;

2. Tranquility II 定制翻译

layerinfo "type" = "i18n";
layerinfo "name" = "Chinese";
layerinfo "langcode" = "zh-cn";
set lang_current = "zh-cn";

set date_format = "%%yyyy%% 年 %%m%% 月 %%d%% 日";

set text_summary_header = "本页文章";
set text_comment_anonymous = "匿名";
set text_comment_viewall = "察看所有评论";
set text_links_header = "跑来跑去";
set text_meta_mood = "情绪";
set text_meta_music = "音乐";

3. Tranquility II 定制 user

layerinfo "type" = "user";
layerinfo "name" = "pink-sai";

set css_style_overrides = "@media screen{body,#header,#menu,#footer,#entries,.ind-entry,.ind-entry h4{background:transparent;}#header,#menu,#entries{border:1px dotted #EB88D0;}body{background-attachment:fixed;background-image:url(\"\");}}";

不知道免费用户能不能看到 LJ 的 Core v1Tranquility II 定制的代码
Tags: 小东西

  • 2020

    Last time I wrote a review was in 2018, about 2017. Or maybe I wrote something elsewhere, maybe on Twitter? It was hard to write something freely…

  • #thotcon badge?

    [root@m4700 ~]# esptool write_flash 0x00000 /home/yuan/tracking/thotcon0x9/tc0x9.bin esptool.py v2.3.1 Connecting.... Detecting chip type...…

  • Portfolio weighted averages

    Last week I got an assignment to make a small Java library for some often used portfolio calculations. A portfolio is a collection of holdings, each…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded