Minamp 1.5: Galician interface

- Interface in Galician by default regardless of the phone's language, with
  English selectable under Axustes -> Idioma; switching rebuilds the screens
- All text in tools/strings.py (key -> English, Galician), generating
  res/values/strings.xml (gl) and res/values-en/strings.xml; layouts now use
  string resources
- util/Tr.java: translations for the network and Plex layers, which can't
  read Android resources (falls back to English in desktop tests)
- net/RefusedException: distinguish "server answered but refused" from
  connection failures
- The connection log stays in English for troubleshooting

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
xockoandClaude Opus 5.5 committed 2026-10-15 00:11:41 +02:00
1 parent 6fd17bc9c5
commit fa67e95fde
29 files changed
+1029 -206

No files matched your search

+23 -23
View File
@@ -103,7 +103,7 @@ public class SetupActivity extends BaseActivity {
private void startPin() {
clearPendingPin();
showBusy("Contacting plex.tv\u2026\n(the first secure connection takes a few seconds on this phone)");
showBusy(str(R.string.contacting_plextv));
final int my = ++pinSeq;
run(new Task<Plex.Pin>() {
public Plex.Pin work() throws Exception { return Plex.createPin(); }
@@ -117,7 +117,7 @@ public class SetupActivity extends BaseActivity {
public void fail(Exception e) {
if (my != pinSeq) return;
show(welcome);
toast("Couldn't reach plex.tv: " + msg(e));
toast(str(R.string.cant_reach_plextv, msg(e)));
}
});
}
@@ -147,7 +147,7 @@ public class SetupActivity extends BaseActivity {
StringBuilder spaced = new StringBuilder();
for (int i = 0; i < code.length(); i++) { if (i > 0) spaced.append(' '); spaced.append(code.charAt(i)); }
pinCode.setText(spaced.toString());
pinStatus.setText("Waiting for you to link\u2026");
pinStatus.setText(R.string.pin_waiting);
show(pinPage);
int my = ++pinSeq;
checkPinNow(my);
@@ -170,7 +170,7 @@ public class SetupActivity extends BaseActivity {
if (my != pinSeq || destroyed || pinCheckRunning) return;
long age = System.currentTimeMillis() - pinStarted;
if (age > 14 * 60 * 1000) {
pinStatus.setText("Code expired \u2014 press Cancel and sign in again");
pinStatus.setText(R.string.pin_expired);
clearPendingPin();
return;
}
@@ -183,11 +183,11 @@ public class SetupActivity extends BaseActivity {
pinChecks++;
if (token == null) {
long left = (14 * 60 * 1000 - (System.currentTimeMillis() - pinStarted)) / 60000;
pinStatus.setText("Not linked yet \u00b7 checked " + pinChecks + "\u00d7 \u00b7 " + left + " min left");
pinStatus.setText(str(R.string.pin_not_yet, pinChecks, (int) left));
schedulePinCheck(my);
return;
}
pinStatus.setText("Linked!");
pinStatus.setText(R.string.pin_linked);
pinSeq++;
clearPendingPin();
signedIn(token);
@@ -196,14 +196,14 @@ public class SetupActivity extends BaseActivity {
pinCheckRunning = false;
if (my != pinSeq) return;
pinChecks++;
pinStatus.setText("Check " + pinChecks + " failed: " + msg(e) + " \u2014 retrying");
pinStatus.setText(str(R.string.pin_check_failed, pinChecks, msg(e)));
schedulePinCheck(my);
}
});
}
private void signedIn(final String account) {
showBusy("Signed in. Finding your servers…");
showBusy(str(R.string.signed_in_finding));
app.prefs.edit().putString("account", account).commit();
run(new Task<String>() {
public String work() throws Exception { return Plex.username(account); }
@@ -213,18 +213,18 @@ public class SetupActivity extends BaseActivity {
}
private void loadServers(final String account) {
showBusy("Finding your servers…");
showBusy(str(R.string.finding_servers));
run(new Task<List<Server>>() {
public List<Server> work() throws Exception { return Plex.servers(account); }
public void done(final List<Server> servers) {
if (servers.isEmpty()) {
show(welcome);
toast("No Plex Media Servers on this account");
toast(str(R.string.no_servers));
return;
}
if (servers.size() == 1) { pickServer(servers.get(0), null); return; }
chooseTitle.setText("Choose a server");
chooseSub.setText("Signed in as " + app.prefs.getString("username", "you"));
chooseTitle.setText(R.string.choose_server);
chooseSub.setText(str(R.string.signed_in_as, app.prefs.getString("username", str(R.string.you))));
chooseList.removeAllViews();
for (int i = 0; i < servers.size(); i++) {
final Server s = servers.get(i);
@@ -233,7 +233,7 @@ public class SetupActivity extends BaseActivity {
int kind = s.connections.get(k).kind;
if (kind == Server.LOCAL || kind == Server.LOCAL_HTTP) local++; else remote++;
}
String sub = (s.owned ? "Yours" : "Shared with you") + " · " + (local > 0 ? "home + " : "") + (remote > 0 ? "remote" : "local only");
String sub = str(s.owned ? R.string.server_yours : R.string.server_shared) + " \u00b7 " + (local > 0 ? str(R.string.server_home_plus) : "") + str(remote > 0 ? R.string.server_remote : R.string.server_local_only);
addChoice(s.name, sub, new View.OnClickListener() {
public void onClick(View v) { pickServer(s, new Runnable() { public void run() { done(servers); } }); }
});
@@ -243,7 +243,7 @@ public class SetupActivity extends BaseActivity {
}
public void fail(Exception e) {
show(welcome);
toast("Couldn't list servers: " + msg(e));
toast(str(R.string.cant_list_servers, msg(e)));
}
});
}
@@ -257,7 +257,7 @@ public class SetupActivity extends BaseActivity {
}
private void pickServer(final Server s, final Runnable back) {
showBusy("Connecting to " + s.name + "…\nTrying home network, then remote, then relay.");
showBusy(str(R.string.connecting_to, s.name));
run(new Task<Server.Conn>() {
public Server.Conn work() throws Exception { return s.pick(); }
public void done(Server.Conn c) {
@@ -275,12 +275,12 @@ public class SetupActivity extends BaseActivity {
private void connectManual() {
String url = ((EditText) findViewById(R.id.edit_url)).getText().toString().trim();
String token = ((EditText) findViewById(R.id.edit_token)).getText().toString().trim();
if (url.length() == 0) { toast("Enter your server's address"); return; }
if (url.length() == 0) { toast(str(R.string.enter_address)); return; }
final Server s = new Server();
s.name = "Plex server";
s.name = str(R.string.plex_server);
s.token = token;
s.add(Server.normalizeManual(url), Server.MANUAL);
showBusy("Connecting…");
showBusy(str(R.string.connecting));
run(new Task<String>() {
public String work() throws Exception {
s.pick();
@@ -294,7 +294,7 @@ public class SetupActivity extends BaseActivity {
public void fail(Exception e) {
show(manual);
boolean auth = e instanceof Plex.PlexException && ((Plex.PlexException) e).code == 401;
toast(auth ? "The server wants a token (or sign in with Plex instead)" : msg(e));
toast(auth ? str(R.string.server_wants_token) : msg(e));
}
});
}
@@ -302,22 +302,22 @@ public class SetupActivity extends BaseActivity {
// ------------------------------------------------------------------ libraries
private void loadSections(final Server s, final Runnable back) {
showBusy("Loading libraries…");
showBusy(str(R.string.loading_libraries));
run(new Task<List<Server.Section>>() {
public List<Server.Section> work() throws Exception { return s.musicSections(); }
public void done(List<Server.Section> secs) {
if (secs.isEmpty()) {
if (back != null) back.run(); else show(welcome);
toast(s.name + " has no music libraries");
toast(str(R.string.no_music_libraries, s.name));
return;
}
if (secs.size() == 1) { finishWith(s, secs.get(0)); return; }
chooseTitle.setText("Choose a music library");
chooseTitle.setText(R.string.choose_library);
chooseSub.setText(s.name);
chooseList.removeAllViews();
for (int i = 0; i < secs.size(); i++) {
final Server.Section sec = secs.get(i);
addChoice(sec.title, "Music", new View.OnClickListener() {
addChoice(sec.title, str(R.string.music), new View.OnClickListener() {
public void onClick(View v) { finishWith(s, sec); }
});
}