Browse Source

Add the needed info the the remote access about screen

merge-requests/1990/head
Nicolas Pomepuy 2 years ago
committed by Duncan McNamara
parent
commit
e9d485ee2f
  1. 3
      application/resources/src/main/res/values/strings.xml
  2. 15
      application/webserver/src/main/java/org/videolan/vlc/webserver/TranslationMapping.kt

3
application/resources/src/main/res/values/strings.xml

@ -1265,4 +1265,7 @@
<string name="metered_connection_warning">Your connection is metered. Fees may apply.</string>
<string name="adding">Adding</string>
<string name="to">to</string>
<string name="device">Device</string>
<string name="connected_device">Connected device</string>
<string name="model">Device model</string>
</resources>

15
application/webserver/src/main/java/org/videolan/vlc/webserver/TranslationMapping.kt

@ -25,8 +25,10 @@
package org.videolan.vlc.webserver
import android.content.Context
import android.os.Build
import androidx.annotation.StringRes
import org.json.JSONObject
import org.videolan.vlc.BuildConfig
object TranslationMapping {
fun generateTranslations(context: Context): String {
@ -34,6 +36,9 @@ object TranslationMapping {
StringMapping.values().forEach {
map[it.name] = context.getString(it.id).replace("%s", "{msg}")
}
map["PORT"] = "android"
map["DEVICE_NAME"] = "${Build.MANUFACTURER} - ${Build.MODEL}"
map["APP_VERSION"] = BuildConfig.VLC_VERSION_NAME
return JSONObject(map.toMap()).toString()
}
@ -110,5 +115,15 @@ object TranslationMapping {
NEW_PLAYLIST(R.string.create_new_playlist),
CREATE(R.string.create),
ADD(R.string.add),
ABOUT(R.string.about),
CONNECTED_DEVICE(R.string.connected_device),
DEVICE_MODEL(R.string.model),
VLC_VERSION(R.string.app_name_full),
REMOTE_ACCESS_TITLE(R.string.remote_access),
REMOTE_ACCESS_HASH_TITLE(R.string.remote_access_hash_title),
REMOTE_ACCESS_VERSION_TITLE(R.string.remote_access_version_title),
REMOTE_ACCESS_VERSION(R.string.remote_access_version),
REMOTE_ACCESS_HASH(R.string.build_remote_access_revision),
LIBRARIES(R.string.libraries),
}
}
Loading…
Cancel
Save