From e0f2d3774e2392feed462fa1707d0fb10602a1e1 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 25 Mar 2019 16:21:42 +0000 Subject: [PATCH] JAL-2717 adjusted code so default correctly returned if i18n fails --- resources/lang/Messages.properties | 18 +++++++++--------- resources/lang/Messages_es.properties | 16 ++++++++-------- src/jalview/gui/ColourMenuHelper.java | 2 +- test/jalview/gui/ColourMenuHelperTest.java | 4 ++-- 4 files changed, 20 insertions(+), 20 deletions(-) diff --git a/resources/lang/Messages.properties b/resources/lang/Messages.properties index 6b56f07..a400afe 100644 --- a/resources/lang/Messages.properties +++ b/resources/lang/Messages.properties @@ -184,22 +184,22 @@ label.out_to_textbox = Output to Textbox label.occupancy = Occupancy # delete Clustal - use FileFormat name instead label.clustal = Clustal -# label.colourScheme_ as in JalviewColourScheme +# label.colourScheme_ as in JalviewColourScheme, spaces removed label.colourScheme_clustal = Clustalx label.colourScheme_blosum62 = BLOSUM62 Score -label.colourScheme_%_identity = Percentage Identity +label.colourScheme_%identity = Percentage Identity label.colourScheme_zappo = Zappo label.colourScheme_taylor = Taylor label.colourScheme_hydrophobic = Hydrophobicity -label.colourScheme_helix_propensity = Helix Propensity -label.colourScheme_strand_propensity = Strand Propensity -label.colourScheme_turn_propensity = Turn Propensity -label.colourScheme_buried_index = Buried Index +label.colourScheme_helixpropensity = Helix Propensity +label.colourScheme_strandpropensity = Strand Propensity +label.colourScheme_turnpropensity = Turn Propensity +label.colourScheme_buriedindex = Buried Index label.colourScheme_purine/pyrimidine = Purine/Pyrimidine label.colourScheme_nucleotide = Nucleotide -label.colourScheme_t-coffee_scores = T-Coffee Scores -label.colourScheme_rna_helices = By RNA Helices -label.colourScheme_sequence_id = Sequence ID Colour +label.colourScheme_t-coffeescores = T-Coffee Scores +label.colourScheme_rnahelices = By RNA Helices +label.colourScheme_sequenceid = Sequence ID Colour label.blc = BLC label.fasta = Fasta label.msf = MSF diff --git a/resources/lang/Messages_es.properties b/resources/lang/Messages_es.properties index c367eea..08373ba 100644 --- a/resources/lang/Messages_es.properties +++ b/resources/lang/Messages_es.properties @@ -183,19 +183,19 @@ label.clustal = Clustal # label.colourScheme_ as in JalviewColourScheme label.colourScheme_clustal = Clustalx label.colourScheme_blosum62 = Puntuación del BLOSUM62 -label.colourScheme_%_identity = Porcentaje de identidad +label.colourScheme_%identity = Porcentaje de identidad label.colourScheme_zappo = Zappo label.colourScheme_taylor = Taylor label.colourScheme_hydrophobic = Hidrofobicidad -label.colourScheme_helix_propensity = Tendencia de la hélice -label.colourScheme_strand_propensity = Tendencia de la hebra -label.colourScheme_turn_propensity = Tendencia de giro -label.colourScheme_buried_index = Índice de encubrimiento +label.colourScheme_helixpropensity = Tendencia de la hélice +label.colourScheme_strandpropensity = Tendencia de la hebra +label.colourScheme_turnpropensity = Tendencia de giro +label.colourScheme_buriedindex = Índice de encubrimiento label.colourScheme_purine/pyrimidine = Purina/Pirimidina label.colourScheme_nucleotide = Nucleótido -label.colourScheme_t-coffee_scores = Puntuación del T-Coffee -label.colourScheme_rna_helices = Por hélices de RNA -label.colourScheme_sequence_id = Color de ID de secuencia +label.colourScheme_t-coffeescores = Puntuación del T-Coffee +label.colourScheme_rnahelices = Por hélices de RNA +label.colourScheme_sequenceid = Color de ID de secuencia label.blc = BLC label.fasta = Fasta label.msf = MSF diff --git a/src/jalview/gui/ColourMenuHelper.java b/src/jalview/gui/ColourMenuHelper.java index 9479ea6..6eab07d 100644 --- a/src/jalview/gui/ColourMenuHelper.java +++ b/src/jalview/gui/ColourMenuHelper.java @@ -121,7 +121,7 @@ public class ColourMenuHelper */ final String name = scheme.getSchemeName(); String label = MessageManager.getStringOrReturn( - "label.colourScheme_", name.toLowerCase().replace(" ", "_")); + "label.colourScheme_", name); final JRadioButtonMenuItem radioItem = new JRadioButtonMenuItem( label); radioItem.setName(name); diff --git a/test/jalview/gui/ColourMenuHelperTest.java b/test/jalview/gui/ColourMenuHelperTest.java index e685155..5128fe5 100644 --- a/test/jalview/gui/ColourMenuHelperTest.java +++ b/test/jalview/gui/ColourMenuHelperTest.java @@ -94,7 +94,7 @@ public class ColourMenuHelperTest * check i18n for display name */ String label = MessageManager.getStringOrReturn("label.colourScheme_", - name.toLowerCase().replace(" ", "_")); + name); assertEquals(item.getText(), label); } @@ -164,7 +164,7 @@ public class ColourMenuHelperTest * check i18n for display name */ String label = MessageManager.getStringOrReturn("label.colourScheme_", - name.toLowerCase().replace(" ", "_")); + name); assertEquals(item.getText(), label); } -- 1.7.10.2