#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Tue, 25 Feb 2020 17:21:16 +0100
changeset 9002 0c1d599727eb
parent 9001 2a2c30b7b382
child 9003 de9be1ccbdb4
#FEATURE by cg class: ResourcePack c strings in resource file changed: #processLine:encoding:file:printErrorWith: #readFromResourceStream:in: class: ResourcePack class changed: #processResourceLine:encoding:file:printErrorWith:for:keepUselessTranslations:
ResourcePack.st
--- a/ResourcePack.st	Sun Feb 23 16:31:45 2020 +0100
+++ b/ResourcePack.st	Tue Feb 25 17:21:16 2020 +0100
@@ -761,7 +761,7 @@
                                 nil
                             ].
     ] ifFalse:[
-        lineStream peek == $' ifTrue:[
+        ((lineString startsWith:'c''') or:[lineStream peek == $']) ifTrue:[
             name := String
                         readSmalltalkStringFrom:lineStream
                         onError:[
@@ -916,6 +916,13 @@
         ]
     ]
 
+    "
+     |p|
+     p := ResourcePack new.
+     self processResourceLine:'''foo'' ''xlation_of_foo''' encoding:nil file:'dummy.rc' printErrorWith:[:err | Logger warn:err] for:p keepUselessTranslations:false.
+     p inspect.
+    "
+
     "Modified: / 06-02-2014 / 15:33:03 / cg"
     "Modified: / 27-03-2019 / 11:59:49 / Claus Gittinger"
     "Modified: / 28-09-2019 / 15:20:38 / Stefan Vogel"
@@ -1722,6 +1729,7 @@
         file:fileName
         printErrorWith:printError
         for:self
+        keepUselessTranslations:false
 !
 
 readFromFile:fileName directory:dirName
@@ -1947,6 +1955,7 @@
                                                 ifFalse:['---'])
                                         printErrorWith:printError
                                         for:self
+                                        keepUselessTranslations:false
                                 ]]
                     ]
                 ]