diff --git a/_config.yml b/_config.yml index 3c88f6a9f0922a6b2de6444d294aa7ba667fee4f..d3b51ac4b0345b3307b2066639f7ab2f43ecb05f 100644 --- a/_config.yml +++ b/_config.yml @@ -13,6 +13,7 @@ kramdown: smart_quotes: ["apos", "apos", "quot", "quot"] exclude: ["README.md"] +languages: ["en", "cn"] gems: [jekyll-paginate] paginate: 10 paginate_path: blog/page:num/ diff --git a/_i18n/cn.yml b/_i18n/cn.yml new file mode 100644 index 0000000000000000000000000000000000000000..e29eda52ffa15fcd6261a8e83f29de47abca52df --- /dev/null +++ b/_i18n/cn.yml @@ -0,0 +1,124 @@ +global: + date: '%Y/%m/%d' + monero: é—¨ç½—å¸ + getting_started: å¯ç”¨ + copyright: Copyright + monero_project: The Monero Project + sitename: getmonero.org, The Monero Project + wiki: Moneropedia + tags: Articles By Tag + wikimeta: on Moneropedia, the open encyclopedia of Monero knowledge + tagsmeta: All Monero blog articles that are tagged + titlemeta: on the home of Monero, a digital currency that is secure, private, and untraceable + terms: æ¡æ¬¾ + privacy: éšç§ + copyright: ç‰ˆæƒ +menu: + forum: è®ºå› + blog: åšå®¢ + knowledge_base: 知识库 + community: 社区 + bitcointalk: Bitcointalk Thread + reddit: Reddit + allblog: All Blog Posts + devdiaries: Dev Diaries + missives: Monero Missives + uncategorised: Uncategorized + choose: How to Choose a Monero Client + running: How to Run a Monero Node + donations: Donating and Sponsorships + downloads: All Monero Downloads + merchants: Merchants and Services Directory + accepting: Accepting Monero Payments + about: About Monero + people: The People Behind Monero + userguides: User Guides + developerguides: Developer Guides + goals: Design & Development Goals + openalias: The OpenAlias Project + lab: Monero Research Lab + alternative: Alternative Clients + projects: External Projects + irc: IRC on Freenode + irc-general: "#monero (General)" + irc-development: "#monero-dev (Development)" + irc-trading: "#monero-otc (OTC Trading)" + irc-markets: "#monero-markets (Markets)" + irc-mining: "#monero-pools (Mining)" +index: + page_title: "Monero - secure, private, untraceable" + what_is_1: "什么是门罗å¸" + what_is_2: " ?" + what_is_orange_block: "门罗å¸æ˜¯ä¸€ç§å®‰å…¨æ€§,éšç§æ€§æžé«˜çš„è´§å¸,åŒæ—¶å…·æœ‰å¼€æ”¾æ€§,适用人群广泛ç‰ç‰¹ç‚¹ã€‚" + what_is_text_block_1: "使用门罗å¸æ—¶,您å¯ä»¥æŽ§åˆ¶æ‚¨çš„银行,æ“控并负责管ç†æ‚¨çš„资金,å…¶ä»–äººæ— æ³•è¿½è¸ªæ‚¨çš„ä»»ä½•è´§å¸ è½¬ç§»è¡Œä¸ºã€‚" + what_is_text_block_2: "想了解更多å—?请å‚考下文ä¸é—¨ç½—å¸çš„主è¦ç‰¹ç‚¹,如您有兴趣å°è¯•é—¨ç½—å¸,åªéœ€ç‚¹å‡»ç½‘页上方的" + what_is_text_block_3: "å¯ç”¨æ ‡ç¾," + what_is_text_block_4: "便å¯äº«å—门罗å¸çš„å“越性。" + news: æ¶ˆæ¯ + the_latest: 最新 + private: éšç§æ€§ + secure: 安全性 + untraceable: æ— è¿¹å¯å¯» + private_text: "门罗å¸é‡‡ç”¨åŠ 密安全系统,å› æ¤,æ— è®ºæ˜¯è½¬å…¥è¿˜æ˜¯è½¬å‡ºèµ„é‡‘,æ•°æ®åŒºå—(分布交易总账)都 很难查出您的交易信æ¯ã€‚è¿™ä¿éšœæ‚¨çš„è´ä¹°,接收,转账行为长期并自动处于éšç§˜çŠ¶æ€ã€‚" + untraceable_text: "群ç¾å是一ç§åŠ 密系统的特性。利用æ¤ç‰¹æ€§,门罗å¸ä¾¿å¯ä»¥ä¿éšœäº¤æ˜“ä¸ç¦æ— 迹å¯å¯»,而且用户也å¯é€‰æ‹©æ¨¡ç³Šäº¤æ˜“与计算机或用户间的è”系。" + secure_text: "æ¯ç¬”äº¤æ˜“éƒ½å› å—到点对点共识网络的ä¿éšœè€Œå…·æœ‰é«˜åº¦å®‰å…¨æ€§ã€‚个人账户在创建时会显示 25个记忆ç§å,并å¯è¢«è®°å½•ä¸‹æ¥ä»¥ä½œå¤‡ä»½ã€‚账户文件å¯åŠ 密,å› æ¤,ç›—å–è¿™äº›æ–‡ä»¶ä¹Ÿæ˜¯æ— ç”¨åŠŸã€‚" + how_do_i_1: "我åˆå¦‚何" + how_do_i_2: " ?" + get_started: 开始呢 + get_started_1: "最快的å¯ç”¨æ–¹å¼ä¾¿æ˜¯ç½‘络账户ç»ç†,如, " + mymonero: "MyMonero" + get_started_2: "." + get_started_3: "或者,如果您希望è¿è¡Œå®Œæ•´é—¨ç½—å¸ç½‘络节点,请点击å³ä¾§ä¸‹è½½é“¾æŽ¥,下载用户端åŠå冲å¯åŠ¨ æ•°æ®åŒºå—(åŠ é€Ÿä¸‹è½½æœ¬åœ°ç”¨æˆ·ç«¯)" + where_can_i: 在哪里 + download_1: 下载 + download_2: " ?" + different_os: "您使用的是其他æ“作系统å—?" + all_downloads: 查看所有å¯ç”¨ç‰ˆæœ¬ + c_download: 下载 + monero_for: 用户 + latest_blockchain: 最新数æ®åŒºå— +blog: + title_1: All + title_2: Blog + title_3: Posts + tagged: Tagged under + author: Posted by + forum: Click here to join the discussion for this entry on the Monero Forum +tags: + all: Articles by Tag + notags: There are no posts for this tag. +gs: + how_to: 如何 + choose: + mobile_web_lightweight: "手机版,网页版,和轻巧版客户端" + mobile_web_lightweight_text_1: "如您是门罗å¸(Monero)çš„åˆæ¬¡ä½¿ç”¨è€…,以下便介ç»çš„客户端便是ç†æƒ³ä¹‹é€‰,åŒæ—¶é€‚用于设备" + mobile_web_lightweight_text_2: "性能有é™,ä¸èƒ½è¿è¡Œå®Œæ•´ç½‘络节点的用户" + my_monero_text_1: "MyMonero.com" + my_monero_text_2: " 使用方法简å•,å¯ç›´æŽ¥åœ¨æµè§ˆå™¨æ€»æ‰“å¼€,æ— éœ€ä¸‹è½½å®‰è£…ã€‚ æ¤ç½‘é¡µæ— æ³•ä»£æ›¿æ‚¨æ”¯é…您的门罗å¸èµ„金,å› æ¤å®‰å…¨åº¦é«˜ã€‚网站由门罗å¸æ ¸å¿ƒå›¢é˜Ÿæˆå‘˜ä¹‹ä¸€ Riccardo Spagni è´Ÿè´£æ“作è¿è¥ã€‚" + full_client: "完整门罗å¸å®¢æˆ·ç«¯" + full_client_text: "如您å¯ä»¥æ‰©å±•å¸¦å®½åŠç¡¬ç›˜ç©ºé—´,并è¿è¡Œå®Œæ•´ç½‘络节点,您便å¯äº«å—强大而稳定的网络,以åŠé—¨ç½—" + monero_node_text_1: "请å‚考" + monero_node_text_2: "门罗å¸ç½‘络节点è¿è¡Œ" + monero_node_text_3: "指å—,也å¯ä»¥ä»Ž" + monero_node_text_4: "下载页é¢" + third_party_clients: "第三方客户端" + third_party_text: "其他与门罗å¸å®˜æ–¹åŽå°åˆä½œçš„第三方客户端会æä¾›å…¶ä»–é™„åŠ åŠŸèƒ½ã€‚" + monerox: "MoneroX 是.NET 版本的门罗å¸ç”¨æˆ·ç•Œé¢,æ¤ç•Œé¢é€‚用于 Windows,Mac åŠ Linux.MoneroX ç”±" + lightwallet: "LightWallet æ˜¯ä¸€æ¬¾è½»ä¾¿ç®€å• Python 版的用户端。æ¤ç”¨æˆ·ç«¯é€‚用于多数æ“作系统。由 jwinterm" + running: + run_a: "è¿è¡Œ" + monero_node: "门罗å¸ç½‘络节点(Monero Node)" + why_run: "为什么è¦è¿è½¬å®Œæ•´ç½‘络节点?" + why_run_text_1: "门罗å¸ç½‘络系统的分散性和对应性决定了它规模越大,功能越强大,çµæ´»æ€§ä¹Ÿè¶Šé«˜ã€‚我们鼓励所 有有æ¡ä»¶çš„用户使用完整网络节点。" + why_run_text_2: "è¿è¡Œé—¨ç½—å¸ç½‘络节点并ä¸éœ€è¦å¼ºå¤§çš„处ç†å™¨,但您确实需è¦ç”¨å‡ 个 GB 的硬æ¿ç©ºé—´æ¥å®‰ç½®æ•°æ®åŒº å—链,并且会对您的带宽有一定影å“,特别是与数æ®åŒºå—链连接的网络节点。" + why_run_text_3: "è¿è¡Œé—¨ç½—å¸ç½‘络节点,而ä¸å½±å“您家åºå¸¦å®½æœ€ç®€å•çš„方法,是è´ä¹° VPS(虚拟专用æœåŠ¡å™¨)。我们强烈推è InterServer.net。使用“门罗å¸â€ä¼˜æƒ 券代ç å¯äº«å—原价 $6/月基础上的折扣。使 用æ¤ä¼˜æƒ 券代ç 或å‹æƒ…链接也æ„味ç€æ‚¨ä¸ºé—¨ç½—å¸çš„å‘展给予一臂之力。" + why_run_text_4: "门罗å¸å¯åœ¨å¤šæ•°ç¡¬ä»¶æ¡ä»¶ä¸‹è¿è¡Œ,包括 ARM åŠ 32 ä½ç³»ç»Ÿã€‚è¿è¡Œç½‘络节点之å‰,è¯·åœ¨ä¸‹è½½é¡µé¢ ä¸‹è½½é—¨ç½—å¸äºŒè¿›åˆ¶æ–‡ä»¶ã€‚" + running_node: "è¿è¡Œç½‘络节点" + running_node_text_1: "旦文件下载åŠè§£åŽ‹å®Œæˆ,您åªéœ€å¼€å§‹è¿è¡Œé—¨ç½—å¸åŽå°,æ— éœ€ä»»ä½•å…¶ä»–æ“作。" + running_node_text_2: "- Windows 用户:在 Windows 资æºç®¡ç†å™¨ä¸æ‰¾åˆ° bitmonerod.exe 并åŒå‡»ã€‚如程åºå¼€å¯ åŽè‡ªåŠ¨å…³é—或崩溃,您å¯ä»¥åœ¨å‘½ä»¤æ示符内å¯åŠ¨,看是å¦ä¾ç„¶å‡ºçŽ°åŒæ ·é—®é¢˜ã€‚" + running_node_text_3: "- OS X 用户:在 Finder ä¸æ‰¾åˆ° bitmonerod 并åŒå‡»ã€‚与 Windows 相åŒ,如程åºå¼€å¯åŽ 自动关é—或崩溃,您å¯ä»¥å°è¯•åœ¨ Terminal ä¸å¯åŠ¨ã€‚" + running_node_text_4: "- Linux用户:如您在桌é¢æˆ–æœåŠ¡å™¨æ“作系统上è¿è¡Œå®ƒ,与æ¤å¯¹åº”您å¯åœ¨Screen作业ä¸æˆ– 其本身的控制å°çª—å£å¯åŠ¨ bitmonerod" + correctly: "ç¡®ä¿æ‚¨çš„节点è¿è¡Œæ£ç¡®" + correctly_text_1: "首次å¯åŠ¨é—¨ç½—网络节点时,ä½ å±å¹•ä¼šæ˜¾ç¤ºå¦‚下图:" + correctly_text_2: "黄色文å—表示在åŒæ¥æ›´æ–°é—¨ç½—网络的剩余部分åŒæ—¶,它也在接收的数æ®åŒºå—。一旦åŒæ¥æˆåŠŸå®Œæˆ, å±å¹•ä¼šæ˜¾ç¤ºç»¿è‰²çš„'synchronized OK'å—æ ·ã€‚è‡³æ¤,您的门罗网络节点顺利开始è¿è¡Œ!" + correctly_text_3: "è‹¥è¦é€€å‡ºèŠ‚点,您å¯åœ¨ä»»ä½•æ—¶å€™åœ¨åŽå°é”®å…¥'exit',然åŽæŒ‰å›žè½¦é”®,程åºä¾¿ä¼šè‡ªè¡Œå…³é—。" diff --git a/_i18n/en.yml b/_i18n/en.yml new file mode 100644 index 0000000000000000000000000000000000000000..8c8562c3f6b551a9071d5adb5b7a7c8dc85ed659 --- /dev/null +++ b/_i18n/en.yml @@ -0,0 +1,124 @@ +global: + date: '%Y/%m/%d' + monero: Monero + getting_started: Getting Started + copyright: Copyright + monero_project: The Monero Project + sitename: getmonero.org, The Monero Project + wiki: Moneropedia + tags: Articles By Tag + wikimeta: on Moneropedia, the open encyclopedia of Monero knowledge + tagsmeta: All Monero blog articles that are tagged + titlemeta: on the home of Monero, a digital currency that is secure, private, and untraceable + terms: Terms + privacy: Privacy + copyright: Copyright +menu: + forum: Forum + blog: Blog + knowledge_base: Knowledge Base + community: Community + bitcointalk: Bitcointalk Thread + reddit: Reddit + allblog: All Blog Posts + devdiaries: Dev Diaries + missives: Monero Missives + uncategorised: Uncategorized + choose: How to Choose a Monero Client + running: How to Run a Monero Node + donations: Donating and Sponsorships + downloads: All Monero Downloads + merchants: Merchants and Services Directory + accepting: Accepting Monero Payments + about: About Monero + people: The People Behind Monero + userguides: User Guides + developerguides: Developer Guides + goals: Design & Development Goals + openalias: The OpenAlias Project + lab: Monero Research Lab + alternative: Alternative Clients + projects: External Projects + irc: IRC on Freenode + irc-general: "#monero (General)" + irc-development: "#monero-dev (Development)" + irc-trading: "#monero-otc (OTC Trading)" + irc-markets: "#monero-markets (Markets)" + irc-mining: "#monero-pools (Mining)" +index: + page_title: "Monero - secure, private, untraceable" + what_is_1: What is + what_is_2: " ?" + what_is_orange_block: "Monero is a secure, private, untraceable currency. It is open-source and freely available to all." + what_is_text_block_1: "With Monero, you are your own bank. Only you control and are responsible for your funds, and your accounts and transactions are kept private from prying eyes." + what_is_text_block_2: "Want to find out more? An overview of Monero's main features are below. If you'd like to try Monero for yourself the" + what_is_text_block_3: "Getting Started" + what_is_text_block_4: "section is an excellent launching point." + news: News + the_latest: The Latest + private: Private + secure: Secure + untraceable: Untraceable + private_text: "Monero uses a cryptographically sound system that allows you to send and receive funds without your @transactions being publically visible on the @blockchain (the distributed ledger of transactions). This ensures that your purchases, receipts, and other transfers remain private by default." + untraceable_text: "By taking advantage of @ring-signatures, a special property of certain types of cryptography, Monero enables untraceable transactions. This means it's ambiguous which funds have been spent, and thus extremely unlikely that a transaction could be linked to particular user." + secure_text: "Using the power of a distributed peer-to-peer @consensus network, every transaction is cryptographically secured. Individual @accounts have a 25 word @mnemonic-seed displayed when created, which can be written down to back up the @account. Account files are encrypted with a passphrase to ensure they are worthless if stolen." + how_do_i_1: "How do I " + how_do_i_2: " ?" + get_started: get started + get_started_1: "The fastest way to start using Monero is with a web @account manager such as " + mymonero: "MyMonero" + get_started_2: "." + get_started_3: "Alternatively, if you would like to run a [full Monero node](/getting-started/running) you can download the client and a kick-starter @blockchain (to bring your local client up to speed) using the download link on the right." + where_can_i: Where can I + download_1: download + download_2: " ?" + different_os: "Need it for a different operating system?" + all_downloads: View all available downloads here + c_download: Download + monero_for: Monero for + latest_blockchain: Latest @Blockchain +blog: + title_1: All + title_2: Blog + title_3: Posts + tagged: Tagged under + author: Posted by + forum: Click here to join the discussion for this entry on the Monero Forum +tags: + all: Articles by Tag + notags: There are no posts for this tag. +gs: + how_to: How to + choose: + mobile_web_lightweight: "Mobile, Web, and Lightweight Clients" + mobile_web_lightweight_text_1: "The clients below are ideal if you are using Monero for the first time. They are also useful if you are on a device that cannot run a " + mobile_web_lightweight_text_2: "full Monero node." + my_monero_text_1: "MyMonero.com" + my_monero_text_2: " is easy-to-use and works in your browser without you needing to install anything. It can be used with some measure of safety, as MyMonero are unable to spend your funds on your behalf. It is owned and operated by Riccardo Spagni, one of the Monero Core Team members." + full_client: "Full Monero Client" + full_client_text: "If you are able to spare the bandwidth and disk space required to run a full node, doing so helps keep the network stable and robust, and also affords you the maximum privacy Monero has to offer." + monero_node_text_1: "You can read our guide on " + monero_node_text_2: "running a Monero node" + monero_node_text_3: ", and the Monero core software can be downloaded from the " + monero_node_text_4: "downloads page" + third_party_clients: "Third-Party Clients" + third_party_text: "There are also several third-party clients that interact with the official Monero core daemon, and are able to provide their own additional functionality." + monerox: "MoneroX is a GUI for Monero written in .NET and available for Windows, Mac, and Linux. It is written and maintained by Jojatekok." + lightwallet: "lightWallet is a simple and slim client written in Python, and should run on most operating systems. It is written and maintained by jwinterm." + running: + run_a: "RUN A" + monero_node: "MONERO NODE" + why_run: "Why Run a Full Node?" + why_run_text_1: "Because of the decentralized and peer-to-peer nature of the Monero network it becomes more robust and resilient as it becomes larger. We encourage all users to run a full node, if they are able to." + why_run_text_2: "Running a Monero node does not require a huge amount of processing power, but it does require a few gigabytes worth of disk space to store the blockchain, and there will be some impact on your bandwidth especially from connected nodes that are catching up on the blockchain." + why_run_text_3: "The easiest way to run a Monero node, without affecting your home bandwidth, is to purchase a VPS (Virtual Private Server). We strongly recommend [InterServer.net](https://interserver.net/dock/vps-231552.html) using the 'MONERO' coupon code to get a discount over and above their already cheap $6/month VPS. Using this coupon code and/or our [affiliate link](https://interserver.net/dock/vps-231552.html) will also assist in the ongoing funding of Monero development." + why_run_text_4: "Monero will run on most hardware, including ARM and 32-bit systems. In order to prepare to run the node download the Monero binaries from the [from the downloads page](/downloads)." + running_node: "Running the Node" + running_node_text_1: "Once you have the files downloaded and unpacked you don't need to do anything beyond running the Monero daemon." + running_node_text_2: "- On Windows: locate bitmonerod.exe in Windows Explorer and double-click on it. If it opens and then closes, or crashes after starting, then you may want to start it from within Command Prompt in order to see what errors arise." + running_node_text_3: "- On OS X: locate bitmonerod in Finder and double-click on it. As with Windows, if it opens and then closes, or crashes after starting, then you can start it from within Terminal." + running_node_text_4: "- On Linux: dependent on whether you are running it on a desktop or server operating system, you will want to start bitmonerod either in a screen session or in a console window of its own." + correctly: "Ensuring Your Node is Running Correctly" + correctly_text_1: "When starting Monero for the first time you will see something similar to this screen:" + correctly_text_2: "The yellow text indicates it is receiving blocks as it synchronises up with the rest of the Monero network. The green 'synchronized ok' text will appear once it has correctly synched up. Once you see this there's nothing further you need to do, you are now running a Monero node!" + correctly_text_3: "To exit the node at any time you can type 'exit' into the daemon window and press enter, and it will shut itself down." diff --git a/_plugins/plugin.rb b/_plugins/plugin.rb index 90191af5b0aa77a6ced15e051cfae030b3518654..8dd6ad9345986ecded43aa75853b00009eb06fc4 100644 --- a/_plugins/plugin.rb +++ b/_plugins/plugin.rb @@ -1,17 +1,230 @@ -# Just a placeholder plugin to do translated strings, gives us room and scope to get the -# jekyll-multiple-languages-plugin to work correctly - module Jekyll - module Translated - module Strings + module Multiple + module Languages module Plugin - VERSION = "0.1" + VERSION = "1.2.9" end end end end module Jekyll + class Site + def read_directories(dir = '') + base = in_source_dir(dir) + entries = Dir.chdir(base) { filter_entries(Dir.entries('.'), base) } + + read_posts(dir) + read_drafts(dir) if show_drafts + posts.sort! + limit_posts! if limit_posts > 0 # limit the posts if :limit_posts option is set + + entries.each do |f| + f_abs = in_source_dir(base, f) + if File.directory?(f_abs) + f_rel = File.join(dir, f) + read_directories(f_rel) unless dest.sub(/\/$/, '') == f_abs + elsif Utils.has_yaml_header?(f_abs) + page = Page.new(self, source, dir, f) + pages << page if publisher.publish?(page) + else + static_files << StaticFile.new(self, source, dir, f) + end + end + + pages.sort_by!(&:name) + end + + def read_posts(dir) + posts = read_content(dir, '_posts', Post) + + posts.each do |post| + aggregate_post_info(post) if publisher.publish?(post) + end + end + + def read_content(dir, magic_dir, klass) + get_entries(dir, magic_dir).map do |entry| + klass.new(self, source, dir, entry) if klass.valid?(entry) + end.reject do |entry| + entry.nil? + end + end + + def get_entries(dir, subfolder) + base = in_source_dir(dir, subfolder) + return [] unless File.exist?(base) + entries = Dir.chdir(base) { filter_entries(Dir['**/*'], base) } + entries.delete_if { |e| File.directory?(in_source_dir(base, e)) } + end + end +end + + +module Jekyll + @parsedlangs = {} + + def self.langs + @parsedlangs + end + + def self.setlangs(l) + @parsedlangs = l + end + + class Site + alias :process_org :process + + def process + if !self.config['baseurl'] + self.config['baseurl'] = "" + end + #Variables + config['baseurl_root'] = self.config['baseurl'] + baseurl_org = self.config['baseurl'] + languages = self.config['languages'] + exclude_org = self.exclude + dest_org = self.dest + + #Loop + self.config['lang'] = self.config['default_lang'] = languages.first + puts + puts "Building site for default language: \"#{self.config['lang']}\" to: #{self.dest}" + process_org + languages.drop(1).each do |lang| + + # Build site for language lang + @dest = @dest + "/" + lang + self.config['baseurl'] = self.config['baseurl'] + "/" + lang + self.config['lang'] = lang + + # exclude folders or files from beeing copied to all the language folders + exclude_from_localizations = self.config['exclude_from_localizations'] || [] + @exclude = @exclude + exclude_from_localizations + + puts "Building site for language: \"#{self.config['lang']}\" to: #{self.dest}" + process_org + + #Reset variables for next language + @dest = dest_org + @exclude = exclude_org + + self.config['baseurl'] = baseurl_org + end + Jekyll.setlangs({}) + puts 'Build complete' + end + + alias :read_posts_org :read_posts + + def read_posts(dir) + if dir == '' + read_posts("_i18n/#{self.config['lang']}/") + else + read_posts_org(dir) + end + end + + alias :read_directories_org :read_directories + + def read_directories(dir = '') + if dir == '' + dir = "_i18n/#{self.config['lang']}/" + end + + base = in_source_dir(dir) + entries = Dir.chdir(base) { filter_entries(Dir.entries('.'), base) } + + read_posts(dir) + read_drafts(dir) if show_drafts + posts.sort! + limit_posts! if limit_posts > 0 # limit the posts if :limit_posts option is set + + entries.each do |f| + f_abs = in_source_dir(base, f) + + if File.directory?(f_abs) + f_rel = File.join(dir, f) + read_directories(f_rel) unless dest.sub(/\/$/, '') == f_abs + elsif Utils.has_yaml_header?(f_abs) || File.extname(f_abs) == ".md" + page = Page.new(self, source, dir, f) + pages << page if publisher.publish?(page) + else + static_files << StaticFile.new(self, source, dir, f) + end + end + + pages.sort_by!(&:name) + end + end + + module Convertible + def write(dest) + lang = self.site.config['lang'] + default_lang = self.site.config['default_lang'] + path = destination(dest) + dest_path = path + + if path.include?('/_i18n/') + start_index = path.index '_i18n/' + + if self.is_a?(Jekyll::Post) + end_index = path.index '/posts/' + dest_path = path[0..start_index-1] + path[(end_index + 1) .. path.length] + elsif self.is_a?(Jekyll::Page) + dest_path = path[0..start_index-1] + path[(start_index + 9) .. path.length] + end + end + + FileUtils.mkdir_p(File.dirname(dest_path)) + + File.open(dest_path, 'wb') do |f| + f.write(output) + end + end + end + + class Post + def url + rel_url = URL.new({ + :template => template, + :placeholders => url_placeholders, + :permalink => permalink + }).to_s + + if rel_url.include?('/_i18n/') + start_index = rel_url.index '_i18n/' + end_index = rel_url.index '/posts/' + rel_url = rel_url[0..start_index-1] + rel_url[(end_index + 1) .. rel_url.length] + end + + @url ||= rel_url + end + end + + class StaticFile + def write(dest) + dest_path = destination(dest) + + orig_path = dest_path + if dest_path.include?('/_i18n/') + start_index = dest_path.index '_i18n/' + dest_path = dest_path[0..start_index-1] + dest_path[(start_index + 9) .. dest_path.length] + end + + # p "#{self.class} #{dest_path}" + + return false if File.exist?(dest_path) and !modified? + @@mtimes[path] = mtime + + FileUtils.mkdir_p(File.dirname(dest_path)) + FileUtils.rm(dest_path) if File.exist?(dest_path) + FileUtils.cp(path, dest_path) + + true + end + end + class LocalizeTag < Liquid::Tag def initialize(tag_name, key, tokens) @@ -25,28 +238,63 @@ module Jekyll else key = @key end + lang = context.registers[:site].config['lang'] + unless Jekyll.langs.has_key?(lang) + puts "Loading translation from file #{context.registers[:site].source}/_i18n/#{lang}.yml" + Jekyll.langs[lang] = YAML.load_file("#{context.registers[:site].source}/_i18n/#{lang}.yml") + end + translation = Jekyll.langs[lang].access(key) if key.is_a?(String) + if translation.nil? or translation.empty? + translation = Jekyll.langs[context.registers[:site].config['default_lang']].access(key) + puts "Missing i18n key: #{lang}:#{key}" + puts "Using translation '%s' from default language: %s" %[translation, context.registers[:site].config['default_lang']] + end + translation + end + end - site = context.registers[:site] + module Tags + class LocalizeInclude < IncludeTag + def render(context) + if "#{context[@file]}" != "" #Check for page variable + file = "#{context[@file]}" + else + file = @file + end - stringsfile = File.join(site.source, '_strings_en.yml') + includes_dir = File.join(context.registers[:site].source, '_i18n/' + context.registers[:site].config['lang']) - strings_en = YAML.load_file(stringsfile) + if File.symlink?(includes_dir) + return "Includes directory '#{includes_dir}' cannot be a symlink" + end + if file !~ /^[a-zA-Z0-9_\/\.-]+$/ || file =~ /\.\// || file =~ /\/\./ + return "Include file '#{file}' contains invalid characters or sequences" + end - translation = strings_en.access(key) if key.is_a?(String) - if translation.nil? || translation.empty? - Jekyll.logger.abort_with "Missing key: #{key}" - end - - # If we have an @, pass the string through the markdown converter, so that we hit the Moneropedia plugin - if translation.include? '@' - converter = site.find_converter_instance(::Jekyll::Converters::Markdown) - translation = converter.convert(translation)[3..-6] - end + Dir.chdir(includes_dir) do + choices = Dir['**/*'].reject { |x| File.symlink?(x) } + if choices.include?(file) + source = File.read(file) + partial = Liquid::Template.parse(source) - translation + context.stack do + context['include'] = parse_params(context) if @params + contents = partial.render(context) + site = context.registers[:site] + ext = File.extname(file) + + converter = site.converters.find { |c| c.matches(ext) } + contents = converter.convert(contents) unless converter.nil? + + contents + end + else + "Included file '#{file}' not found in #{includes_dir} directory" + end + end + end end end - end unless Hash.method_defined? :access @@ -68,3 +316,5 @@ end Liquid::Template.register_tag('t', Jekyll::LocalizeTag) Liquid::Template.register_tag('translate', Jekyll::LocalizeTag) +Liquid::Template.register_tag('tf', Jekyll::Tags::LocalizeInclude) +Liquid::Template.register_tag('translate_file', Jekyll::Tags::LocalizeInclude) \ No newline at end of file diff --git a/getting-started/choose.md b/getting-started/choose.md index 385e6117f197a3b02acc0b3cf9af9b9b217360ec..757dc10152e22a8f50592c65035be02928bf6c05 100644 --- a/getting-started/choose.md +++ b/getting-started/choose.md @@ -9,9 +9,9 @@ icon: "icon_client" attribution: "<!-- Icon is based on work by Freepik (http://www.freepik.com) and is licensed under Creative Commons BY 3.0 -->" --- -### Mobile, Web, and Lightweight Clients +### {% t gs.choose.mobile_web_lightweight %} -The clients below are ideal if you are using Monero for the first time. They are also useful if you are on a device that cannot run a [full Monero node](/getting-started/running). +{% t gs.choose.mobile_web_lightweight_text_1 %} [{% t gs.choose.mobile_web_lightweight_text_2 %}](/getting-started/running). --- @@ -19,33 +19,31 @@ The clients below are ideal if you are using Monero for the first time. They are [](https://mymonero.com) {:.text-center} -[MyMonero.com](https://mymonero.com) is easy-to-use and works in your browser without you needing to install anything. -It can be used with some measure of safety, as MyMonero are unable to spend your funds on your behalf. -It is owned and operated by Riccardo Spagni, one of the Monero Core Team members. +[{% t gs.choose.my_monero_text_1 %}](https://mymonero.com) {% t gs.choose.my_monero_text_2 %} --- -### Full Monero Client +### {% t gs.choose.full_client %} -If you are able to spare the bandwidth and disk space required to run a full node, doing so helps keep the network stable and robust, and also affords you the maximum privacy Monero has to offer. +{% t gs.choose.full_client_text %} --- {:.text-center .client-list #monerocore} [](/downloads) -You can read our guide on [running a Monero node](/getting-started/running), and the Monero core software can be downloaded from the [downloads page](/downloads). +{% t gs.choose.monero_node_text_1 %} [{% t gs.choose.monero_node_text_1 %}](/getting-started/running), {% t gs.choose.monero_node_text_3 %} [{% t gs.choose.monero_node_text_4 %}](/downloads). --- -### Third-Party Clients +### {% t gs.choose.third_party_clients %} -There are also several third-party clients that interact with the official Monero core daemon, and are able to provide their own additional functionality. +{% t gs.choose.third_party_text %} --- {:.text-center .client-list #monerox}  -MoneroX is a GUI for Monero written in .NET and available for Windows, Mac, and Linux. It is written and maintained by Jojatekok. +{% t gs.choose.monerox %} {:.text-center .client-list} **Current Version:** 1.0.0 @@ -64,7 +62,7 @@ MoneroX is a GUI for Monero written in .NET and available for Windows, Mac, and {:.text-center .client-list #lightwallet} [](https://forum.getmonero.org/20/general-discussion/166/lightwallet-a-lightweight-monero-gui-account-manager) -lightWallet is a simple and slim client written in Python, and should run on most operating systems. It is written and maintained by jwinterm. +{% t gs.choose.lightwallet %} {:.text-center .client-list} **Current Version:** 0.0.2-alpha diff --git a/getting-started/index.md b/getting-started/index.md index c3d42bba785c75d523b59d24a901d32f9d555732..891eadece6c170ac4773e4902c4dc27c3912daae 100644 --- a/getting-started/index.md +++ b/getting-started/index.md @@ -14,7 +14,7 @@ attribution: "<!-- Icon is based on work by Freepik (http://www.freepik.com) and --- -<div class="text-center" style="padding-bottom: 15px;"><a style="color: #505050;" href="/getting-started/choose"><img src="//static.getmonero.org/images/icon_client.svg" class="title-icon"><h2 class="inline">How to <span class="green-kicks">Choose</span> a Monero Client</h2></a></div> +<div class="text-center" style="padding-bottom: 15px;"><a style="color: #505050;" href="/getting-started/choose"><img src="//static.getmonero.org/images/icon_client.svg" class="title-icon"><h2 class="inline">{% t gs.how_to %}<span class="green-kicks">Choose</span> a Monero Client</h2></a></div> <div class="text-center" style="padding-bottom: 15px;"><a style="color: #505050;" href="/getting-started/running"><img src="//static.getmonero.org/images/icon_node.svg" class="title-icon"><h2 class="inline">How to Run a <span class="yellow-kicks">Monero Node</span></h2></a></div> diff --git a/getting-started/running.md b/getting-started/running.md index a375124cd5bdbf97fa832065eaf17145d24d80d7..0c72582e8f5d01e4171dc798d95b46024ab946a6 100644 --- a/getting-started/running.md +++ b/getting-started/running.md @@ -9,29 +9,29 @@ icon: "icon_node" attribution: "<!-- Icon is based on work by Freepik (http://www.freepik.com) and is licensed under Creative Commons BY 3.0 -->" --- -### Why Run a Full Node? +### {% t gs.running.why_run %} -Because of the decentralized and peer-to-peer nature of the Monero network it becomes more robust and resilient as it becomes larger. We encourage all users to run a full node, if they are able to. +{% t gs.running.why_run_text_1 %} -Running a Monero node does not require a huge amount of processing power, but it does require a few gigabytes worth of disk space to store the blockchain, and there will be some impact on your bandwidth especially from connected nodes that are catching up on the blockchain. +{% t gs.running.why_run_text_2 %} -The easiest way to run a Monero node, without affecting your home bandwidth, is to purchase a VPS (Virtual Private Server). We strongly recommend [InterServer.net](https://interserver.net/dock/vps-231552.html) using the 'MONERO' coupon code to get a discount over and above their already cheap $6/month VPS. Using this coupon code and/or [our affiliate link](https://interserver.net/dock/vps-231552.html) will also assist in the ongoing funding of Monero development. +{% t gs.running.why_run_text_3 %} -Monero will run on most hardware, including ARM and 32-bit systems. In order to prepare to run the node download the Monero binaries [from the downloads page](/downloads). +{% t gs.running.why_run_text_4 %} -### Running the Node +### {% t gs.running.running_node %} -Once you have the files downloaded and unpacked you don't need to do anything beyond running the Monero daemon. +{% t gs.running.running_node_text_1 %} -- On Windows: locate bitmonerod.exe in Windows Explorer and double-click on it. If it opens and then closes, or crashes after starting, then you may want to start it from within Command Prompt in order to see what errors arise. +{% t gs.running.running_node_text_2 %} -- On OS X: locate bitmonerod in Finder and double-click on it. As with Windows, if it opens and then closes, or crashes after starting, then you can start it from within Terminal. +{% t gs.running.running_node_text_3 %} -- On Linux: dependent on whether you are running it on a desktop or server operating system, you will want to start bitmonerod either in a screen session or in a console window of its own. +{% t gs.running.running_node_text_4 %} -### Ensuring Your Node is Running Correctly +### {% t gs.running.correctly %} -When starting Monero for the first time you will see something similar to this screen: +{% t gs.running.correctly_text_1 %} {:.cli-code} 2015-Feb-18 00:09:45.699104 Core initialized OK @@ -47,6 +47,6 @@ SYNCHRONIZATION started SYNCHRONIZATION started</span> <span style="color: lime;">2015-Feb-18 00:10:01.719800 [P2P4][197.242.158.240:28080 OUT] SYNCHRONIZED OK</span> -The yellow text indicates it is receiving blocks as it synchronises up with the rest of the Monero network. The green "synchronized ok" text will appear once it has correctly synched up. Once you see this there's nothing further you need to do, you are now running a Monero node! +{% t gs.running.correctly_text_2 %} -To exit the node at any time you can type "exit" into the daemon window and press enter, and it will shut itself down. \ No newline at end of file +{% t gs.running.correctly_text_3 %} \ No newline at end of file diff --git a/language.php b/language.php index d564327bddbbd89992fb1d2898eb671c777d3fa0..743f24039161fc515b3aa10eecd7eb45aa0887f1 100644 --- a/language.php +++ b/language.php @@ -47,11 +47,16 @@ if (isset($_COOKIE["MONERO_LANG"])) <div class="container main-content"> <div class="row"> - <div class="col-md-4 col-md-offset-2"> + <div class="col-md-4"> <ul class="nav nav-pills nav-stacked flag-select"> <li><a href="/home"><h3><img class="flag" src="//static.getmonero.org/images/flags/english_combined.png"> English</h3></a></li> </ul> </div> + <div class="col-md-4"> + <ul class="nav nav-pills nav-stacked flag-select"> + <li><a href="/cn/"><h3><img class="flag" src="//static.getmonero.org/images/flags/china.png"> 简体ä¸æ–‡</h3></a></li> + </ul> + </div> <div class="col-md-4"> <ul class="nav nav-pills nav-stacked flag-select"> <li><h3 style="line-height: 50px; padding: 10px 20px;"><img class="flag" src="//static.getmonero.org/images/flags/allflags.png"> More to come...</h3></li>