Add comments for translators regarding unit of storage abbreviations
authorLunar <lunar@anargeek.net>
Tue, 20 Dec 2016 11:51:19 +0000 (12:51 +0100)
committerLunar <lunar@anargeek.net>
Tue, 20 Dec 2016 12:38:13 +0000 (13:38 +0100)
Rakefile
lib/coquelicot/num.rb

index 8f2d077..021b645 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -29,7 +29,8 @@ GetText::Tools::XGetText.add_parser(Haml::MagicTranslations::XGetText::HamlParse
 GetText::Tools::Task.define do |task|
   task.spec = Gem::Specification.load('coquelicot.gemspec')
   task.files = Dir.glob('views/**/*.{rb,haml}') + Dir.glob('lib/coquelicot/**/*.rb')
-  task.xgettext_options = ['--msgid-bugs-address=Coquelicot developers <coquelicot@potager.org>']
+  task.xgettext_options = ['--msgid-bugs-address=Coquelicot developers <coquelicot@potager.org>',
+                           '--add-comments=TRANSLATORS']
 end
 
 task :create_archive do
index 916a34e..ac6411e 100644 (file)
@@ -22,7 +22,16 @@ module Coquelicot::Num
 
   # found on: http://codereview.stackexchange.com/questions/9107/
   def as_size
-    prefix = [N_('TiB'), N_('GiB'), N_('MiB'), N_('KiB'), N_('B')]
+    prefix = [# TRANSLATORS: Abbreviated unit of storage. See https://en.wiktionary.org/wiki/tebibyte
+              N_('TiB'),
+              # TRANSLATORS: Abbreviated unit of storage. See https://en.wiktionary.org/wiki/gibibyte
+              N_('GiB'),
+              # TRANSLATORS: Abbreviated unit of storage. See https://en.wiktionary.org/wiki/mebibyte
+              N_('MiB'),
+              # TRANSLATORS: Abbreviated unit of storage. See https://en.wiktionary.org/wiki/kibibyte
+              N_('KiB'),
+              # TRANSLATORS: Abbreviated unit of storage. See https://en.wiktionary.org/wiki/byte
+              N_('B')]
     s = self.to_f
     i = prefix.length - 1
     while s > 512 && i > 0