Commit b4f458641a99d3504539c530b07f0ef948477cab
1 parent
e6febcd3
Exists in
master
and in
28 other branches
ActionItem523: adding __ as a shortcut for Noosfero.term plus
translation git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2302 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
6 changed files
with
10 additions
and
4 deletions
Show diff stats
app/views/shared/user_menu.rhtml
@@ -17,7 +17,7 @@ | @@ -17,7 +17,7 @@ | ||
17 | 17 | ||
18 | <li><a href="<%= homepage_path(:profile => current_user.login) %>" | 18 | <li><a href="<%= homepage_path(:profile => current_user.login) %>" |
19 | help="<%= _('Go to your home page.') %>" | 19 | help="<%= _('Go to your home page.') %>" |
20 | - ><span class="icon-menu-home"></span><%= Noosfero.term(N_('My Home Page')) %></a></li> | 20 | + ><span class="icon-menu-home"></span><%= __('My Home Page') %></a></li> |
21 | 21 | ||
22 | <!-- li><a href="#"><span class="icon-menu-blog"></span> Meu Blog</a></li --> | 22 | <!-- li><a href="#"><span class="icon-menu-blog"></span> Meu Blog</a></li --> |
23 | 23 |
lib/noosfero.rb
1 | -require 'gettext' | ||
2 | - | ||
3 | module Noosfero | 1 | module Noosfero |
4 | PROJECT = 'noosfero' | 2 | PROJECT = 'noosfero' |
5 | VERSION = '0.11.0' | 3 | VERSION = '0.11.0' |
@@ -33,7 +31,7 @@ module Noosfero | @@ -33,7 +31,7 @@ module Noosfero | ||
33 | end | 31 | end |
34 | 32 | ||
35 | def self.term(t) | 33 | def self.term(t) |
36 | - gettext(self.terminology.get(t)) | 34 | + self.terminology.get(t) |
37 | end | 35 | end |
38 | def self.terminology | 36 | def self.terminology |
39 | @terminology ||= Noosfero::Terminology::Default.new | 37 | @terminology ||= Noosfero::Terminology::Default.new |
lib/noosfero/core_ext.rb
lib/tasks/gettext.rake
@@ -13,6 +13,7 @@ end | @@ -13,6 +13,7 @@ end | ||
13 | desc "Update pot/po files to match new version." | 13 | desc "Update pot/po files to match new version." |
14 | task :updatepo do | 14 | task :updatepo do |
15 | require 'gettext/utils' | 15 | require 'gettext/utils' |
16 | + GetText::RubyParser::ID << '__' | ||
16 | GetText::ActiveRecordParser.init(:use_classname => false) | 17 | GetText::ActiveRecordParser.init(:use_classname => false) |
17 | GetText.update_pofiles(Noosfero::PROJECT, Dir.glob("{app,lib,public/designs}/**/*.{rb,rhtml}"), | 18 | GetText.update_pofiles(Noosfero::PROJECT, Dir.glob("{app,lib,public/designs}/**/*.{rb,rhtml}"), |
18 | "#{Noosfero::PROJECT} #{Noosfero::VERSION}") | 19 | "#{Noosfero::PROJECT} #{Noosfero::VERSION}") |
lib/zen3_terminology.rb
@@ -4,6 +4,7 @@ class Zen3Terminology < Noosfero::Terminology::Custom | @@ -4,6 +4,7 @@ class Zen3Terminology < Noosfero::Terminology::Custom | ||
4 | include GetText | 4 | include GetText |
5 | 5 | ||
6 | def initialize | 6 | def initialize |
7 | + # NOTE: the hash values must be marked for translation!! | ||
7 | super({ | 8 | super({ |
8 | 'My Home Page' => N_('My ePortfolio'), | 9 | 'My Home Page' => N_('My ePortfolio'), |
9 | }) | 10 | }) |