IT Blog

  • Blog
  • Technology
    • Technology
    • Architecture
    • CMS
    • CRM
    • Web
    • DotNET
    • Python
    • Database
    • BI
    • Program Language
  • Users
    • Login
    • Register
    • Forgot Password?
  • ENEN
    • 中文中文
    • ENEN
Experience IT
In a World of Technology, People Make the Difference.
  1. Home
  2. Technology
  3. CMS
  4. Wordpress
  5. Plugin
  6. WordPress Event Calendar 的汉化

WordPress Event Calendar 的汉化

2018-09-23 961 Views 0 Like 0 Comments

1.翻译文件

/wp-content/plugins/the-events-calendar/lang/the-events-calendar-zh_CN.po 和
/wp-content/plugins/the-events-calendar/common/lang/tribe-common-zh_CN.po

可以利用工具插件Loco Translate进行翻译。

Loco-Translate sample

2. 由于英语和汉语的语序不同,用上述方法无法得到理想的效果。这时可以用JavaScript来翻译。可以借助插件 Custom CSS & JS 添加js脚本。如日历的标题翻译后效果如下图。

calendar-title-translate
加以下js脚本后:

  //event calendar
  var obj = $(".tribe-events-page-title");
  var title = obj.text();	                //"活动 for 九月 2018"
  //obj.text(title.replace(' for ',': '));      //"活动: 九月 2018"
  var yr = title.substring(title.length-4);     //2018
  var mth = title.substring(7, title.length-5); //九月
  obj.text(yr+"年"+mth);

calendar-title-translate

 2,318 total views,  4 views today

error
fb-share-icon
Tweet
fb-share-icon
IT Team
Author: IT Team

Tags: None
Last updated:2021-01-02

IT Team

This person is lazy and left nothing

Like
< Previous
Next >

Comments

Cancel reply
Chinese (Simplified) Chinese (Simplified) Chinese (Traditional) Chinese (Traditional) English English French French German German Japanese Japanese Korean Korean Russian Russian
Newest Hotspots Random
Newest Hotspots Random
Rich editor not working Making web page scroll down automatically Getting data from Dapper result All Unicode Chars How to keep and display contact form 7 data Common Regular Expressions
Download URLs Remote connection to MySQL on SiteGround Rich editor not working Page view count Open and close all links inside a page for testing Social media
Categories
  • Architecture
  • BI
  • C#
  • CSS
  • Database
  • DotNET
  • Hosting
  • HTML
  • JavaScript
  • PHP
  • Program Language
  • Python
  • Security
  • SEO
  • Technology
  • Web
  • Wordpress

COPYRIGHT © 2021 Hostlike IT Blog. All rights reserved.

This site is supported by Hostlike.com