From adbf62ad7d68b780b60e2e26d8dc1c82e51d63c7 Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Wed, 8 May 2019 13:42:11 +0300 Subject: [PATCH] - Replaced all strings with string resource references. - Added missing 7.3.0 changelog file. --- app/src/main/AndroidManifest.xml | 18 +- .../com/tutpro/baresip/AboutActivity.kt | 2 +- .../com/tutpro/baresip/AccountActivity.kt | 46 ++--- .../com/tutpro/baresip/BaresipService.kt | 18 +- .../kotlin/com/tutpro/baresip/ChatActivity.kt | 25 +-- .../com/tutpro/baresip/ConfigActivity.kt | 26 ++- .../kotlin/com/tutpro/baresip/MainActivity.kt | 90 ++++----- app/src/main/res/layout/activity_account.xml | 34 ++-- app/src/main/res/layout/activity_accounts.xml | 2 +- app/src/main/res/layout/activity_chat.xml | 2 +- app/src/main/res/layout/activity_chats.xml | 2 +- app/src/main/res/layout/activity_config.xml | 20 +- app/src/main/res/layout/activity_contact.xml | 6 +- app/src/main/res/layout/activity_main.xml | 6 +- app/src/main/res/layout/call_notification.xml | 6 +- app/src/main/res/layout/password_dialog.xml | 2 +- .../main/res/layout/status_notification.xml | 4 +- app/src/main/res/menu/accounts_menu.xml | 4 +- app/src/main/res/menu/contacts_menu.xml | 4 +- app/src/main/res/menu/main_menu.xml | 8 +- app/src/main/res/values/strings.xml | 173 +++++++++++++++--- .../android/en-US/changelogs/7.3.0.txt | 3 + 22 files changed, 323 insertions(+), 178 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/7.3.0.txt diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1b1aa9ae..4d98ad7a 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -46,50 +46,50 @@ diff --git a/app/src/main/kotlin/com/tutpro/baresip/AboutActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/AboutActivity.kt index d20cf905..85c668ce 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/AboutActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/AboutActivity.kt @@ -14,7 +14,7 @@ class AboutActivity : AppCompatActivity() { super.onCreate(savedInstanceState) setContentView(R.layout.activity_about) val aboutText = findViewById(R.id.aboutText) as TextView - aboutText.text = String.format(getText(R.string.aboutText).toString(), + aboutText.text = String.format(getText(R.string.about_text).toString(), BuildConfig.VERSION_NAME) aboutText.setTextColor(Color.BLACK) } diff --git a/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt index 2b3df81c..e1e6d2ae 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/AccountActivity.kt @@ -390,43 +390,47 @@ class AccountActivity : AppCompatActivity() { fun onClick(v: View) { when (v) { findViewById(R.id.DisplayNameTitle) as TextView-> { - Utils.alertView(this, "Display Name", getString(R.string.dispName)) + Utils.alertView(this, getString(R.string.display_name), + getString(R.string.display_name_help)) } findViewById(R.id.AuthUserTitle) as TextView -> { - Utils.alertView(this, "Authentication Username", - getString(R.string.authUser)) + Utils.alertView(this, getString(R.string.authentication_username), + getString(R.string.authentication_username_help)) } findViewById(R.id.AuthPassTitle) as TextView-> { - Utils.alertView(this, "Authentication Password", - getString(R.string.authPass)) + Utils.alertView(this, getString(R.string.authentication_password), + getString(R.string.authentication_password_help)) } findViewById(R.id.OutboundProxyTitle) as TextView -> { - Utils.alertView(this, "Outbound Proxies", - getString(R.string.obProxies)) + Utils.alertView(this, getString(R.string.outbound_proxies), + getString(R.string.outbound_proxies_help)) } findViewById(R.id.RegTitle) as TextView -> { - Utils.alertView(this, "Register", getString(R.string.register)) - } - findViewById(R.id.MediaNatTitle) as TextView -> { - Utils.alertView(this, "Media NAT Traversal", getString(R.string.mediaNat)) - } - findViewById(R.id.StunServerTitle) as TextView -> { - Utils.alertView(this, "STUN Server", getString(R.string.stunServer)) + Utils.alertView(this, "Register", getString(R.string.register_help)) } findViewById(R.id.AudioCodecsTitle) as TextView -> { - Utils.alertView(this, "Audio Codecs", getString(R.string.auCodecs)) + Utils.alertView(this, getString(R.string.audio_codecs), + getString(R.string.audio_codecs_help)) + } + findViewById(R.id.MediaNatTitle) as TextView -> { + Utils.alertView(this, getString(R.string.media_nat), + getString(R.string.media_nat_help)) + } + findViewById(R.id.StunServerTitle) as TextView -> { + Utils.alertView(this, getString(R.string.stun_server), + getString(R.string.stun_server_help)) } findViewById(R.id.MediaEncTitle) as TextView -> { - Utils.alertView(this, "Media Encryption", - getText(R.string.mediaEnc).toString()) + Utils.alertView(this, getString(R.string.media_encryption), + getString(R.string.media_encryption_help)) } findViewById(R.id.VoicemailUriTitle) as TextView -> { - Utils.alertView(this, "Voicemail URI", - getText(R.string.vmUri).toString()) + Utils.alertView(this, getString(R.string.voicemail_uri), + getString(R.string.voicemain_uri_help)) } findViewById(R.id.DefaultTitle) as TextView -> { - Utils.alertView(this, "Default Account", - getText(R.string.defaultAccount).toString()) + Utils.alertView(this, getString(R.string.default_account), + getText(R.string.default_account_help).toString()) } } } diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt index 15e69969..10396a79 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt @@ -351,7 +351,7 @@ class BaresipService: Service() { R.color.colorBaresip)) .setContentIntent(pi) .setAutoCancel(true) - .setContentTitle("Incoming call from") + .setContentTitle(getString(R.string.incoming_call_from)) .setContentText(caller) if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { nb.setVibrate(LongArray(0)) @@ -368,8 +368,10 @@ class BaresipService: Service() { rejectIntent.putExtra("callp", callp) val rejectPendingIntent = PendingIntent.getService(this, REJECT_REQ_CODE, rejectIntent, PendingIntent.FLAG_UPDATE_CURRENT) - nb.addAction(R.drawable.ic_stat, "Answer", answerPendingIntent) - nb.addAction(R.drawable.ic_stat, "Reject", rejectPendingIntent) + nb.addAction(R.drawable.ic_stat, getString(R.string.answer), + answerPendingIntent) + nb.addAction(R.drawable.ic_stat, getString(R.string.reject), + rejectPendingIntent) nm.notify(CALL_NOTIFICATION_ID, nb.build()) return } @@ -436,7 +438,7 @@ class BaresipService: Service() { .setContentIntent(pi) .setDefaults(Notification.DEFAULT_SOUND) .setAutoCancel(true) - .setContentTitle("Call transfer request to") + .setContentTitle(getString(R.string.transfer_request)) .setContentText(target) if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { nb.setVibrate(LongArray(0)) @@ -455,8 +457,10 @@ class BaresipService: Service() { denyIntent.putExtra("callp", callp) val denyPendingIntent = PendingIntent.getService(this, DENY_REQ_CODE, denyIntent, PendingIntent.FLAG_UPDATE_CURRENT) - nb.addAction(R.drawable.ic_stat, "Accept", acceptPendingIntent) - nb.addAction(R.drawable.ic_stat, "Deny", denyPendingIntent) + nb.addAction(R.drawable.ic_stat, getString(R.string.accept), + acceptPendingIntent) + nb.addAction(R.drawable.ic_stat, getString(R.string.deny), + denyPendingIntent) nm.notify(TRANSFER_NOTIFICATION_ID, nb.build()) return } @@ -541,7 +545,7 @@ class BaresipService: Service() { .setContentIntent(pi) .setSound(Settings.System.DEFAULT_NOTIFICATION_URI) .setAutoCancel(true) - .setContentTitle("Message from $sender") + .setContentTitle(getString(R.string.message_from) + " " + sender) .setContentText(text) if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { nb.setVibrate(LongArray(0)) diff --git a/app/src/main/kotlin/com/tutpro/baresip/ChatActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/ChatActivity.kt index 4e493ba9..4668ac57 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/ChatActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/ChatActivity.kt @@ -59,10 +59,10 @@ class ChatActivity : AppCompatActivity() { else chatPeer = chatPeer.substring(4) } - setTitle("Chat with $chatPeer") + setTitle("${getString(R.string.chat_with)} $chatPeer") val headerView = findViewById(R.id.account) as TextView - val headerText = "Account ${aor.substringAfter(":")}" + val headerText = "${getString(R.string.account)} ${aor.substringAfter(":")}" headerView.text = headerText listView = findViewById(R.id.messages) as ListView @@ -99,16 +99,17 @@ class ChatActivity : AppCompatActivity() { } } val builder = AlertDialog.Builder(this@ChatActivity, R.style.Theme_AppCompat) - if (chatPeer.contains("@") || Utils.checkTelNo(chatPeer)) - builder.setMessage("Do you want to delete message or add peer $chatPeer to contacts?") - .setPositiveButton("Cancel", dialogClickListener) - .setNegativeButton("Delete Message", dialogClickListener) - .setNeutralButton("Add Contact", dialogClickListener) + if (ContactsActivity.contactName(peerUri) == peerUri) + builder.setMessage(String.format(getText(R.string.long_message_question).toString(), + chatPeer)) + .setPositiveButton(getString(R.string.cancel), dialogClickListener) + .setNegativeButton(getString(R.string.delete_message), dialogClickListener) + .setNeutralButton(getString(R.string.add_contact), dialogClickListener) .show() else - builder.setMessage("Do you want to delete message?") - .setPositiveButton("Cancel", dialogClickListener) - .setNegativeButton("Delete Message", dialogClickListener) + builder.setMessage(getText(R.string.short_message_question)) + .setPositiveButton(getString(R.string.cancel), dialogClickListener) + .setNegativeButton(getString(R.string.delete_message), dialogClickListener) .show() true } @@ -133,10 +134,10 @@ class ChatActivity : AppCompatActivity() { Message.add(msg) chatMessages.add(msg) if (Api.message_send(ua.uap, peerUri, msgText, time.toString()) != 0) { - Toast.makeText(getApplicationContext(), "Sending of message failed!", + Toast.makeText(getApplicationContext(), "${getString(R.string.message_failed)}!", Toast.LENGTH_SHORT).show() msg.direction = R.drawable.arrow_up_red - msg.responseReason = "Sending of message failed" + msg.responseReason = getString(R.string.message_failed) } else { newMessage.text.clear() BaresipService.chatTexts.remove("$aor::$peerUri") diff --git a/app/src/main/kotlin/com/tutpro/baresip/ConfigActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/ConfigActivity.kt index 1d12aa5c..b3ade67f 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/ConfigActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/ConfigActivity.kt @@ -218,31 +218,39 @@ class ConfigActivity : AppCompatActivity() { fun onClick(v: View) { when (v) { findViewById(R.id.AutoStartTitle) as TextView-> { - Utils.alertView(this, "Start Automatically", getString(R.string.autoStart)) + Utils.alertView(this, getString(R.string.start_automatically), + getString(R.string.start_automatically_help)) } findViewById(R.id.ListenAddressTitle) as TextView-> { - Utils.alertView(this, "Listen Address", getString(R.string.listenAddress)) + Utils.alertView(this, getString(R.string.listen_address), + getString(R.string.listen_address_help)) } findViewById(R.id.PreferIPv6Title) as TextView-> { - Utils.alertView(this, "Prefer IPv6", getString(R.string.preferIPv6)) + Utils.alertView(this, getString(R.string.prefer_ipv6), + getString(R.string.prefer_ipv6_help)) } findViewById(R.id.DnsServersTitle) as TextView -> { - Utils.alertView(this, "DNS Servers", getString(R.string.dnsServers)) + Utils.alertView(this, getString(R.string.dns_servers), + getString(R.string.dns_servers_help)) } findViewById(R.id.OpusBitRateTitle) as TextView-> { - Utils.alertView(this, "Opus Bit Rate", getString(R.string.opusBitRate)) + Utils.alertView(this, getString(R.string.opus_bit_rate), + getString(R.string.opus_bit_rate_help)) } findViewById(R.id.IceLiteTitle) as TextView-> { - Utils.alertView(this, "ICE Lite Mode", getString(R.string.iceLite)) + Utils.alertView(this, getString(R.string.ice_lite_mode), + getString(R.string.ice_lite_mode_help)) } findViewById(R.id.VolumeTitle) as TextView-> { - Utils.alertView(this, "Call Volume", getString(R.string.callVolume)) + Utils.alertView(this, getString(R.string.default_call_volume), + getString(R.string.default_call_volume_help)) } findViewById(R.id.DebugTitle) as TextView-> { - Utils.alertView(this, "Debug", getString(R.string.debug)) + Utils.alertView(this, getString(R.string.debug), getString(R.string.debug_help)) } findViewById(R.id.ResetTitle) as TextView-> { - Utils.alertView(this, "Reset", getString(R.string.reset)) + Utils.alertView(this, getString(R.string.reset_config), + getString(R.string.reset_config_help)) } } } diff --git a/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt index 7e4563b9..cb6317f9 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt @@ -208,18 +208,18 @@ class MainActivity : AppCompatActivity() { securityButton.setOnClickListener { when (securityButton.tag) { "red" -> { - Utils.alertView(this, "Alert", "This call is NOT secure!") + Utils.alertView(this, getString(R.string.alert), + getString(R.string.call_not_secure)) } "yellow" -> { - Utils.alertView(this, "Alert", - "This call is SECURE, but peer is NOT verified!") + Utils.alertView(this, getString(R.string.alert), + getString(R.string.peer_not_verified)) } "green" -> { val unverifyDialog = AlertDialog.Builder(this) - unverifyDialog.setTitle("Info") - unverifyDialog.setMessage("This call is SECURE and peer is VERIFIED! " + - "Do you want to unverify the peer?") - unverifyDialog.setPositiveButton("Unverify") { dialog, _ -> + unverifyDialog.setTitle(getString(R.string.info)) + unverifyDialog.setMessage(getString(R.string.call_is_secure)) + unverifyDialog.setPositiveButton(getString(R.string.unverify)) { dialog, _ -> val calls = Call.uaCalls(UserAgent.uas()[aorSpinner.selectedItemPosition], "") if (calls.size > 0) { @@ -233,7 +233,7 @@ class MainActivity : AppCompatActivity() { } dialog.dismiss() } - unverifyDialog.setNegativeButton("No") { dialog, _ -> + unverifyDialog.setNegativeButton(getString(R.string.no)) { dialog, _ -> dialog.dismiss() } unverifyDialog.create().show() @@ -257,7 +257,8 @@ class MainActivity : AppCompatActivity() { } } if (!Utils.checkSipUri(uri)) - Utils.alertView(this, "Notice", "Invalid SIP URI '$uri'") + Utils.alertView(this, getString(R.string.notice), + "${getString(R.string.invalid_sip_uri)} '$uri'") else call(ua, uri, "outgoing") } else { @@ -328,11 +329,11 @@ class MainActivity : AppCompatActivity() { val rate = status.split('=')[1] val txCodec = codecs.split(',')[0].split("/") val rxCodec = codecs.split(',')[1].split("/") - Utils.alertView(this, "Call Info", - "Duration: $duration\n" + - "Codecs: ${txCodec[0]} ch ${txCodec[2]}/" + + Utils.alertView(this, getString(R.string.call_info), + "${getString(R.string.duration)}: $duration\n" + + "${getString(R.string.codecs)}: ${txCodec[0]} ch ${txCodec[2]}/" + "${rxCodec[0]} ch ${rxCodec[2]}\n" + - "Rate: $rate") + "${getString(R.string.rate)}: $rate") } } } @@ -359,10 +360,10 @@ class MainActivity : AppCompatActivity() { } val builder = AlertDialog.Builder(this@MainActivity, R.style.Theme_AppCompat) - builder.setTitle("Voicemail Messages") + builder.setTitle(getString(R.string.voicemail_messages)) builder.setMessage(acc.vmMessage()) - .setPositiveButton("Cancel", dialogClickListener) - .setNegativeButton("Check", dialogClickListener) + .setPositiveButton(getString(R.string.cancel), dialogClickListener) + .setNegativeButton(getString(R.string.check), dialogClickListener) .show() } } @@ -447,7 +448,7 @@ class MainActivity : AppCompatActivity() { when (action) { "call" -> { if (!Call.calls().isEmpty()) { - Toast.makeText(applicationContext, "You already have an active call!", + Toast.makeText(applicationContext, getString(R.string.call_already_active), Toast.LENGTH_SHORT).show() return } @@ -561,9 +562,9 @@ class MainActivity : AppCompatActivity() { Log.d("Baresip", "Handling service event 'stopped' with param ${params[0]}") if (params[0] != "") { val alertDialog = AlertDialog.Builder(this).create() - alertDialog.setTitle("Notice") - alertDialog.setMessage("Baresip failed to start! Listen Address was reset. Restart baresip.") - alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, "OK" + alertDialog.setTitle(getString(R.string.notice)) + alertDialog.setMessage(getString(R.string.start_failed)) + alertDialog.setButton(AlertDialog.BUTTON_NEUTRAL, getString(R.string.ok) ) { dialog, _ -> dialog.dismiss() quitTimer.cancel() @@ -601,7 +602,8 @@ class MainActivity : AppCompatActivity() { "registering failed" -> { uaAdapter.notifyDataSetChanged() Toast.makeText(applicationContext, - "Registering of $aor failed: ${ev[1]}", + String.format(getText(R.string.registering_failed).toString(), + aor) + ": ${ev[1]}", Toast.LENGTH_LONG).show() } "call ringing" -> { @@ -618,7 +620,7 @@ class MainActivity : AppCompatActivity() { Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_DENIED) { Toast.makeText(applicationContext, - "You have not granted microphone permission.", + getString(R.string.no_microphone_permission), Toast.LENGTH_SHORT).show() Api.ua_hangup(uap, callp, 486, "Busy Here") return @@ -633,7 +635,7 @@ class MainActivity : AppCompatActivity() { (ua != UserAgent.uas()[aorSpinner.selectedItemPosition])) { aorSpinner.setSelection(account_index) } else { - callTitle.text = "Incoming call from ..." + callTitle.text = getString(R.string.incoming_call_from_dots) callUri.setAdapter(null) callUri.setText(Utils.friendlyUri(ContactsActivity.contactName(call.peerURI), Utils.aorDomain(ua.account.aor))) @@ -665,9 +667,9 @@ class MainActivity : AppCompatActivity() { setVolumeControlStream(AudioManager.STREAM_VOICE_CALL) if (ua == UserAgent.uas()[aorSpinner.selectedItemPosition]) { if (call.dir == "in") - callTitle.text = "Incoming call from ..." + callTitle.text = getString(R.string.incoming_call_from_dots) else - callTitle.text = "Outgoing call to ..." + callTitle.text = getString(R.string.outgoing_call_to_dots) if (acc.mediaEnc == "") { securityButton.visibility = View.INVISIBLE } else { @@ -683,7 +685,7 @@ class MainActivity : AppCompatActivity() { holdButton.setImageResource(R.drawable.pause) holdButton.visibility = View.VISIBLE dtmf.setText("") - dtmf.hint = "DTMF" + dtmf.hint = getString(R.string.dtmf) dtmf.visibility = View.VISIBLE dtmf.requestFocus() if (dtmfWatcher != null) dtmf.removeTextChangedListener(dtmfWatcher) @@ -700,9 +702,9 @@ class MainActivity : AppCompatActivity() { return } val verifyDialog = AlertDialog.Builder(this@MainActivity) - verifyDialog.setTitle("Verify") - verifyDialog.setMessage("Do you want to verify SAS <${ev[1]}> <${ev[2]}>?") - verifyDialog.setPositiveButton("Yes") { dialog, _ -> + verifyDialog.setTitle(getString(R.string.verify)) + verifyDialog.setMessage("${getString(R.string.verify_sas)} <${ev[1]}> <${ev[2]}>?") + verifyDialog.setPositiveButton(getString(R.string.yes)) { dialog, _ -> val security: Int if (Api.cmd_exec("zrtp_verify ${ev[3]}") != 0) { Log.e("Baresip", "Command 'zrtp_verify ${ev[3]}' failed") @@ -719,7 +721,7 @@ class MainActivity : AppCompatActivity() { dialog.dismiss() } } - verifyDialog.setNegativeButton("No") { dialog, _ -> + verifyDialog.setNegativeButton(getString(R.string.no)) { dialog, _ -> call.security = R.drawable.box_yellow call.zid = ev[3] if (ua == UserAgent.uas()[aorSpinner.selectedItemPosition]) { @@ -758,15 +760,15 @@ class MainActivity : AppCompatActivity() { val transferDialog = AlertDialog.Builder(this) val target = Utils.friendlyUri(ContactsActivity.contactName(ev[1]), Utils.aorDomain(aor)) - transferDialog.setMessage("Do you accept to transfer call to $target?") - transferDialog.setPositiveButton("Yes") { dialog, _ -> + transferDialog.setMessage("${getString(R.string.transfer_query)} $target?") + transferDialog.setPositiveButton(getString(R.string.yes)) { dialog, _ -> if (call in Call.calls()) Api.ua_hangup(uap, callp, 0, "") call(ua, ev[1], "transferring") showCall(ua) dialog.dismiss() } - transferDialog.setNegativeButton("No") { dialog, _ -> + transferDialog.setNegativeButton(getString(R.string.no)) { dialog, _ -> if (call in Call.calls()) Api.call_notify_sipfrag(callp, 603, "Decline") dialog.dismiss() @@ -795,10 +797,12 @@ class MainActivity : AppCompatActivity() { val param = ev[1].trim() if ((param != "") && (Call.uaCalls(ua, "").size == 0)) { if (param.get(0).isDigit()) - Toast.makeText(applicationContext, "Call failed: $param", + Toast.makeText(applicationContext, + "${getString(R.string.call_failed)}: $param", Toast.LENGTH_LONG).show() else - Toast.makeText(applicationContext, "Call closed: $param", + Toast.makeText(applicationContext, + "${getString(R.string.call_closed)}: $param", Toast.LENGTH_LONG).show() } } @@ -959,8 +963,8 @@ class MainActivity : AppCompatActivity() { CONFIG_CODE -> { if ((resultCode == RESULT_OK) && (data!!.getBooleanExtra("restart", true))) - Utils.alertView(this, "Notice", - "You need to restart baresip in order to activate the new config!") + Utils.alertView(this, getString(R.string.notice), + getString(R.string.restart_needed)) if (resultCode == RESULT_CANCELED) Log.d("Baresip", "Config canceled") } @@ -1000,7 +1004,7 @@ class MainActivity : AppCompatActivity() { if (ContextCompat.checkSelfPermission(applicationContext, Manifest.permission.RECORD_AUDIO) == PackageManager.PERMISSION_DENIED) { Toast.makeText(applicationContext, - "You have not granted microphone permission.", Toast.LENGTH_SHORT).show() + getString(R.string.no_microphone_permission), Toast.LENGTH_SHORT).show() return } if (ua != UserAgent.uas()[aorSpinner.selectedItemPosition]) @@ -1073,9 +1077,9 @@ class MainActivity : AppCompatActivity() { private fun showCall(ua: UserAgent) { if (Call.uaCalls(ua, "").size == 0) { - callTitle.text = "Outgoing call to ..." + callTitle.text = getString(R.string.outgoing_call_to_dots) callUri.text.clear() - callUri.hint = "Callee" + callUri.hint = getString(R.string.callee) callUri.isFocusable = true callUri.isFocusableInTouchMode = true imm.hideSoftInputFromWindow(callUri.windowToken, 0) @@ -1096,11 +1100,11 @@ class MainActivity : AppCompatActivity() { if (callsOut.size > 0) { call = callsOut[callsOut.size - 1] if (call.status == "transferring") - callTitle.text = "Transferring call to ..." + callTitle.text = getString(R.string.transferring_call_to_dots) else - callTitle.text = "Outgoing call to ..." + callTitle.text = getString(R.string.outgoing_call_to_dots) } else { - callTitle.text = "Incoming call from ..." + callTitle.text = getString(R.string.incoming_call_from_dots) call = callsIn[callsIn.size - 1] } callUri.setText(Utils.friendlyUri(ContactsActivity.contactName(call.peerURI), diff --git a/app/src/main/res/layout/activity_account.xml b/app/src/main/res/layout/activity_account.xml index 201cc407..e592f39f 100644 --- a/app/src/main/res/layout/activity_account.xml +++ b/app/src/main/res/layout/activity_account.xml @@ -23,13 +23,13 @@ android:textSize="18sp" android:textColor="@android:color/black" android:onClick="onClick" - android:text="Display Name" > + android:text="@string/display_name" > @@ -42,13 +42,13 @@ android:textSize="18sp" android:textColor="@android:color/black" android:onClick="onClick" - android:text="Authentication Username" > + android:text="@string/authentication_username" > @@ -61,13 +61,13 @@ android:textSize="18sp" android:textColor="@android:color/black" android:onClick="onClick" - android:text="Authentication Password" > + android:text="@string/authentication_password" > @@ -80,13 +80,13 @@ android:textSize="18sp" android:textColor="@android:color/black" android:onClick="onClick" - android:text="Outbound Proxies" > + android:text="@string/outbound_proxies" > @@ -95,7 +95,7 @@ @@ -113,7 +113,7 @@ android:textSize="18sp" android:textColor="@android:color/black" android:onClick="onClick" - android:text="Register" > + android:text="@string/register" > + android:text="@string/audio_codecs" > + android:text="@string/media_nat" > + android:text="@string/stun_server" > + android:text="@string/media_encryption" > + android:text="@string/voicemail_uri" > @@ -232,7 +232,7 @@ android:textSize="18sp" android:textColor="@android:color/black" android:onClick="onClick" - android:text="Default Account" > + android:text="@string/default_account" > + android:hint="@string/sip_uri_user_domain" > + android:hint="@string/new_message" > + android:hint="@string/new_chat_peer" > + android:text="@string/start_automatically" > @@ -60,7 +60,7 @@ android:layout_centerVertical="true" android:layout_marginBottom="12dp" android:textSize="18sp" - android:hint="0.0.0.0:5060" > + android:hint="@string/_0_0_0_0_5060" > + android:text="@string/prefer_ipv6" > @@ -124,7 +124,7 @@ android:textSize="18sp" android:textColor="@android:color/black" android:onClick="onClick" - android:text="Opus Bit Rate" > + android:text="@string/opus_bit_rate" > + android:text="@string/ice_lite_mode" > + android:text="@string/default_call_volume" > + android:text="@string/debug" > + android:text="@string/reset_config" > + android:text="@string/contact_name" > + android:text="@string/sip_uri" > diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 643784c4..89bda16d 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -39,7 +39,7 @@ android:paddingStart="3dp" android:textSize="20sp" android:textColor="@android:color/black" - android:text="Outgoing call to ..." > + android:text="@string/outgoing_call_to_dots" > + android:hint="@string/callee" > @@ -140,7 +140,7 @@ android:layout_marginStart="140dp" android:inputType="phone" android:textSize="20sp" - android:hint="DTMF" + android:hint="@string/dtmf" android:visibility="invisible" > diff --git a/app/src/main/res/layout/call_notification.xml b/app/src/main/res/layout/call_notification.xml index 513ae8aa..989fac53 100644 --- a/app/src/main/res/layout/call_notification.xml +++ b/app/src/main/res/layout/call_notification.xml @@ -26,7 +26,7 @@ android:layout_gravity="center" android:textSize="15dp" android:textColor="#000000" - android:text="Baresip " + android:text="@string/app_name" style = "@android:style/TextAppearance.Medium" /> @@ -49,7 +49,7 @@ android:layout_marginBottom="14dp" android:layout_marginStart="16dp" android:layout_gravity="center" - android:text="Answer" /> + android:text="@string/answer" />