← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 16478: (Utils) Minor adjustment to translation cleaning script to remove duplicates. First wins.

 

------------------------------------------------------------
revno: 16478
committer: Jason Pickering <jason.p.pickering@xxxxxxxxx>
branch nick: dhis2
timestamp: Fri 2014-08-22 04:43:25 -0400
message:
  (Utils) Minor adjustment to translation cleaning script to remove duplicates. First wins.
modified:
  resources/util/clean_translations.R


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'resources/util/clean_translations.R'
--- resources/util/clean_translations.R	2014-07-02 16:17:28 +0000
+++ resources/util/clean_translations.R	2014-08-22 08:43:25 +0000
@@ -76,6 +76,8 @@
 translation<-translation[as.character(translation$value_template) != as.character(translation$value_translation),]
 #Remove any empty values
 translation<-translation[as.character(translation$value_translation) != "",]
+#Remove any duplicates
+translation<-translation[!duplicated(translation),]
 #Arrange as the same order as in the template
 translation<-arrange(translation,template_order)
 out<-paste0(translation$key,"=",translation$value_translation)
@@ -83,4 +85,4 @@
 
 } #Module loop
 }# If statement
-} #Main loop
\ No newline at end of file
+} #Main loop