ChiliProject is not maintained anymore.
Please be advised that there will be no more updates.
We do not recommend that you setup new ChiliProject instances and
we urge all existing users to migrate their data to a maintained
system, e.g. Redmine. We will
provide a migration script later. In the meantime, you can use the
instructions by
Christian Daehn.
Forums » Develop »
i18n Deprecation - Syntax changes
Added by Eric Davis at 2011-03-19 08:19 pm
This is a notice of a deprecation in the syntax for the i18n locales.
- ChiliProject 1.2 will deprecate using
@ for interpolation. Locales will need to be updated to use
%{ }@ instead.
- ChiliProject 2.0 will remove support for the @@ interpolation syntax.
Deprecation warnings have been added to the logger. They will happen only once per startup so if you are running an application in production you should only see these messages once per process.
Eric Davis
Eric Davis wrote:
- ChiliProject 1.2 will deprecate using
@ for interpolation. Locales will need to be updated to use
{ }@ instead.
Wasn't it %{ }
?
To update a plugin of mine, I have used the following script:
#!/usr/bin/env ruby
require "tempfile"
require "fileutils"
Dir['config/locales/*.yml'].each do |filename|
temp = Tempfile.new("plugin_locale")
File.foreach(filename) do |line|
temp << line.gsub(/\{\{(.*?)\}\}/, '%{\1}')
end
temp.close
# FileUtils.cp(filename, "#{filename}.bak")
FileUtils.mv(temp.path, filename)
end
If you are not using proper VCS systems, you might want to uncomment the line after temp.close
.
Gregor
For the record: I removed the sticky flag as I consider the transition to be mostly over/done.