Crowdin use two letter codes (#1131)
This commit is contained in:
parent
8e9950a111
commit
77eddd7779
|
|
@ -67,6 +67,7 @@ import org.lsposed.manager.ui.widget.LinkifyTextView;
|
||||||
import org.lsposed.manager.util.NavUtil;
|
import org.lsposed.manager.util.NavUtil;
|
||||||
import org.lsposed.manager.util.chrome.CustomTabsURLSpan;
|
import org.lsposed.manager.util.chrome.CustomTabsURLSpan;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
@ -182,15 +183,13 @@ public class RepoItemFragment extends BaseFragment implements RepoLoader.Listene
|
||||||
var contentTypes = reply.header("content-type", "image/*;charset=utf-8").split(";\\s*");
|
var contentTypes = reply.header("content-type", "image/*;charset=utf-8").split(";\\s*");
|
||||||
var mimeType = contentTypes.length > 0 ? contentTypes[0] : "image/*";
|
var mimeType = contentTypes.length > 0 ? contentTypes[0] : "image/*";
|
||||||
var charset = contentTypes.length > 1 ? contentTypes[1].split("=\\s*")[1] : "utf-8";
|
var charset = contentTypes.length > 1 ? contentTypes[1].split("=\\s*")[1] : "utf-8";
|
||||||
Log.e(App.TAG, "type " + mimeType);
|
|
||||||
Log.e(App.TAG, "charset " + charset);
|
|
||||||
return new WebResourceResponse(
|
return new WebResourceResponse(
|
||||||
mimeType,
|
mimeType,
|
||||||
charset,
|
charset,
|
||||||
reply.body().byteStream()
|
reply.body().byteStream()
|
||||||
);
|
);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
return null;
|
return new WebResourceResponse("text/html", "utf-8", new ByteArrayInputStream(Log.getStackTraceString(e).getBytes(StandardCharsets.UTF_8)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
files: [
|
files: [
|
||||||
{
|
{
|
||||||
"source" : "/app/src/main/res/values/strings.xml",
|
"source" : "/app/src/main/res/values/strings.xml",
|
||||||
"translation" : "/app/src/main/res/values-%android_code%/%original_file_name%",
|
"translation" : "/app/src/main/res/values-%two_letters_code%/%original_file_name%",
|
||||||
"type": "android",
|
"type": "android",
|
||||||
"dest": "/app/strings.xml",
|
"dest": "/app/strings.xml",
|
||||||
"skip_untranslated_strings": true
|
"skip_untranslated_strings": true
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue