Skip to content

Commit

Permalink
DeepL: added flags
Browse files Browse the repository at this point in the history
  • Loading branch information
M66B committed May 17, 2021
1 parent e2c6a36 commit 6068c58
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions ATTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ FairEmail uses:
* [Compact Encoding Detection](https://github.com/google/compact_enc_det). Copyright 2016 Google Inc. [Apache License 2.0](https://github.com/google/compact_enc_det/blob/master/LICENSE).
* [Compact Language Detector v3](https://github.com/google/cld3). Copyright 2016 Google Inc. All rights reserved. [Apache License 2.0](https://github.com/google/cld3/blob/master/LICENSE).
* [POI-HMEF](https://poi.apache.org/components/hmef/index.html). Copyright © 2001-2020 The Apache Software Foundation. [Apache Software License v2](https://poi.apache.org/devel/guidelines.html#The+Licensing).
* [GoSquared's Flag Icon Set](https://github.com/gosquared/flags). Copyright (c) 2017 Go Squared Ltd. [MIT License](https://github.com/gosquared/flags/blob/master/LICENSE.txt).
1 change: 1 addition & 0 deletions app/src/main/assets/ATTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ FairEmail uses:
* [Compact Encoding Detection](https://github.com/google/compact_enc_det). Copyright 2016 Google Inc. [Apache License 2.0](https://github.com/google/compact_enc_det/blob/master/LICENSE).
* [Compact Language Detector v3](https://github.com/google/cld3). Copyright 2016 Google Inc. All rights reserved. [Apache License 2.0](https://github.com/google/cld3/blob/master/LICENSE).
* [POI-HMEF](https://poi.apache.org/components/hmef/index.html). Copyright © 2001-2020 The Apache Software Foundation. [Apache Software License v2](https://poi.apache.org/devel/guidelines.html#The+Licensing).
* [GoSquared's Flag Icon Set](https://github.com/gosquared/flags). Copyright (c) 2017 Go Squared Ltd. [MIT License](https://github.com/gosquared/flags/blob/master/LICENSE.txt).
11 changes: 9 additions & 2 deletions app/src/main/java/eu/faircode/email/FragmentCompose.java
Original file line number Diff line number Diff line change
Expand Up @@ -1448,11 +1448,18 @@ public boolean onLongClick(View v) {
String json = Helper.readStream(is);
JSONArray jarray = new JSONArray(json);

String pkg = getContext().getPackageName();
for (int i = 0; i < jarray.length(); i++) {
JSONObject jlanguage = jarray.getJSONObject(i);
String name = jlanguage.getString("name");
String target = jlanguage.getString("language");
SubMenu smenu = menu.findItem(R.id.menu_translate).getSubMenu();
smenu.add(R.id.group_translate, i + 1, i + 1, jlanguage.getString("name"))
.setIntent(new Intent().putExtra("target", jlanguage.getString("language")));
MenuItem item = smenu.add(R.id.group_translate, i + 1, i + 1, name)
.setIntent(new Intent().putExtra("target", target));
String resname = "language_" + target.toLowerCase().replace('-', '_');
int resid = getResources().getIdentifier(resname, "drawable", pkg);
if (resid > 0)
item.setIcon(resid);
}
} catch (Throwable ex) {
Log.e(ex);
Expand Down
Binary file added app/src/main/resExtra/drawable/language_de.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/resExtra/drawable/language_en_gb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/resExtra/drawable/language_en_us.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/resExtra/drawable/language_es.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/resExtra/drawable/language_fr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/main/resExtra/drawable/language_it.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6068c58

Please sign in to comment.