File tree Expand file tree Collapse file tree 4 files changed +21
-5
lines changed
main/java/io/simplelocalize/cli
java/io/simplelocalize/cli/processor/keys Expand file tree Collapse file tree 4 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 1212import java .io .InputStream ;
1313import java .io .UnsupportedEncodingException ;
1414import java .net .URLDecoder ;
15+ import java .nio .charset .StandardCharsets ;
1516import java .nio .file .Path ;
1617import java .nio .file .Paths ;
1718
@@ -21,12 +22,12 @@ public class ConfigurationLoader {
2122
2223 private Logger log = LoggerFactory .getLogger (ConfigurationLoader .class );
2324
24- public Configuration load (String path ) throws UnsupportedEncodingException {
25+ public Configuration load (String path ) {
2526
2627 Path configurationFilePath = Paths .get (path );
2728 log .info ("Using configuration file in path: {}" , configurationFilePath );
2829
29- File file = new File (URLDecoder .decode (String .valueOf (configurationFilePath .toFile ()), "utf-8" )); ;
30+ File file = new File (URLDecoder .decode (String .valueOf (configurationFilePath .toFile ()), StandardCharsets . UTF_8 )) ;
3031
3132 if (!file .exists ()) {
3233 throw new ConfigurationNotFoundException ("Could not find configuration file in: " + path );
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public static List<String> tryReadLines(Path filePath) {
2828 Path decodedFilePath = null ;
2929 List <String > fileLines = Collections .emptyList ();
3030 try {
31- decodedFilePath = Paths .get (URLDecoder .decode (String .valueOf (Paths .get (String .valueOf (filePath ))), "utf-8" ));
31+ decodedFilePath = Paths .get (URLDecoder .decode (String .valueOf (Paths .get (String .valueOf (filePath ))), StandardCharsets . UTF_8 ));
3232 fileLines = Files .readAllLines (decodedFilePath , StandardCharsets .UTF_8 );
3333 } catch (IOException e ) {
3434 log .warn ("Cannot read file from path " + decodedFilePath .toString (), e );
@@ -40,7 +40,7 @@ public static List<String> tryReadLines(Path filePath) {
4040 public static String tryReadContent (Path filePath ) {
4141 Path decodedFilePath = null ;
4242 try {
43- decodedFilePath = Paths .get (URLDecoder .decode (String .valueOf (Paths .get (String .valueOf (filePath ))), "utf-8" ));
43+ decodedFilePath = Paths .get (URLDecoder .decode (String .valueOf (Paths .get (String .valueOf (filePath ))), StandardCharsets . UTF_8 ));
4444 return Files .readString (decodedFilePath , StandardCharsets .UTF_8 );
4545 } catch (IOException e ) {
4646 log .warn ("Cannot read file from path " + decodedFilePath .toString (), e );
Original file line number Diff line number Diff line change @@ -23,14 +23,16 @@ public void shouldExtractKeysFromLines() throws Exception {
2323 Set <String > keys = reactIntlKeyExtractor .extractKeysFromFile (Paths .get (path ));
2424
2525 //then
26- Assertions .assertThat (keys ).hasSize (8 );
26+ Assertions .assertThat (keys ).hasSize (10 );
2727 Assertions .assertThat (keys ).containsExactlyInAnyOrder (
2828 "VISITS" ,
2929 "LIKES" ,
3030 "CREATED_COUNT" ,
3131 "COMMENTS" ,
3232 "COVER_IMAGE.PLACEHOLDER" ,
3333 "COVER_IMAGE.TITLE" ,
34+ "COVER_IMAGE.PLACEHOLDER_DOUBLE" ,
35+ "COVER_IMAGE.TITLE_DOUBLE" ,
3436 "ACHIEVEMENTS" ,
3537 "AVAILABLE_SOON"
3638 );
Original file line number Diff line number Diff line change @@ -197,6 +197,19 @@ class UserPage extends Component {
197197 /> :
198198 null }
199199
200+ { showingLoggedUser ?
201+ < ImageUploaderGroup
202+ onImageUploaded = { this . onCoverUploaded }
203+ title = { intl . formatMessage ( defineMessages ( {
204+ id : "COVER_IMAGE.TITLE_DOUBLE" ,
205+ defaultMessage : "Change cover photo"
206+ } ) ) }
207+ message = { intl . formatMessage ( defineMessages ( { id : "COVER_IMAGE.PLACEHOLDER_DOUBLE" ,
208+ defaultMessage : "Drop photo here, we will take care of everything"
209+ } ) ) }
210+ /> :
211+ null }
212+
200213 < h2 className = "text-center" >
201214 < FormattedMessage
202215 id = "ACHIEVEMENTS"
You can’t perform that action at this time.
0 commit comments