Commit 185dd93c authored by Govind Dixit's avatar Govind Dixit

update strings and finalise PR

parent fad79100
...@@ -44,7 +44,7 @@ import javax.inject.Inject ...@@ -44,7 +44,7 @@ import javax.inject.Inject
private const val CURRENT_STATE = "current_state" private const val CURRENT_STATE = "current_state"
class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
HasSupportFragmentInjector { HasSupportFragmentInjector {
@Inject @Inject
lateinit var activityDispatchingAndroidInjector: DispatchingAndroidInjector<Activity> lateinit var activityDispatchingAndroidInjector: DispatchingAndroidInjector<Activity>
@Inject @Inject
...@@ -74,6 +74,7 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, ...@@ -74,6 +74,7 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
presenter.loadEmojis() presenter.loadEmojis()
setupToolbar() setupToolbar()
setupNavigationView() setupNavigationView()
loadLocale()
} }
override fun onSaveInstanceState(outState: Bundle?) { override fun onSaveInstanceState(outState: Bundle?) {
...@@ -104,13 +105,13 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, ...@@ -104,13 +105,13 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
override fun activityInjector(): AndroidInjector<Activity> = activityDispatchingAndroidInjector override fun activityInjector(): AndroidInjector<Activity> = activityDispatchingAndroidInjector
override fun supportFragmentInjector(): AndroidInjector<Fragment> = override fun supportFragmentInjector(): AndroidInjector<Fragment> =
fragmentDispatchingAndroidInjector fragmentDispatchingAndroidInjector
override fun showUserStatus(userStatus: UserStatus) { override fun showUserStatus(userStatus: UserStatus) {
headerLayout.apply { headerLayout.apply {
image_user_status.setImageDrawable( image_user_status.setImageDrawable(
DrawableHelper.getUserStatusDrawable(userStatus, this.context) DrawableHelper.getUserStatusDrawable(userStatus, this.context)
) )
} }
} }
...@@ -120,7 +121,7 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, ...@@ -120,7 +121,7 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
with(uiModel) { with(uiModel) {
if (userStatus != null) { if (userStatus != null) {
image_user_status.setImageDrawable( image_user_status.setImageDrawable(
DrawableHelper.getUserStatusDrawable(userStatus, context) DrawableHelper.getUserStatusDrawable(userStatus, context)
) )
} }
if (userDisplayName != null) { if (userDisplayName != null) {
...@@ -177,29 +178,29 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, ...@@ -177,29 +178,29 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
override fun alertNotRecommendedVersion() { override fun alertNotRecommendedVersion() {
AlertDialog.Builder(this) AlertDialog.Builder(this)
.setMessage( .setMessage(
getString( getString(
R.string.msg_ver_not_recommended, R.string.msg_ver_not_recommended,
BuildConfig.RECOMMENDED_SERVER_VERSION BuildConfig.RECOMMENDED_SERVER_VERSION
)
) )
) .setPositiveButton(R.string.msg_ok, null)
.setPositiveButton(R.string.msg_ok, null) .create()
.create() .show()
.show()
} }
override fun blockAndAlertNotRequiredVersion() { override fun blockAndAlertNotRequiredVersion() {
AlertDialog.Builder(this) AlertDialog.Builder(this)
.setMessage( .setMessage(
getString( getString(
R.string.msg_ver_not_minimum, R.string.msg_ver_not_minimum,
BuildConfig.REQUIRED_SERVER_VERSION BuildConfig.REQUIRED_SERVER_VERSION
)
) )
) .setOnDismissListener { presenter.logout() }
.setOnDismissListener { presenter.logout() } .setPositiveButton(R.string.msg_ok, null)
.setPositiveButton(R.string.msg_ok, null) .create()
.create() .show()
.show()
} }
override fun invalidateToken(token: String) = invalidateFirebaseToken(token) override fun invalidateToken(token: String) = invalidateFirebaseToken(token)
...@@ -215,7 +216,7 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, ...@@ -215,7 +216,7 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
} }
fun setupNavigationView() { fun setupNavigationView() {
with (view_navigation.menu) { with(view_navigation.menu) {
clear() clear()
setupMenu(this) setupMenu(this)
} }
...@@ -234,10 +235,10 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, ...@@ -234,10 +235,10 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
fun showLogoutDialog() { fun showLogoutDialog() {
val builder = AlertDialog.Builder(this) val builder = AlertDialog.Builder(this)
builder.setTitle(R.string.title_are_you_sure) builder.setTitle(R.string.title_are_you_sure)
.setPositiveButton(R.string.action_logout) { _, _ -> presenter.logout()} .setPositiveButton(R.string.action_logout) { _, _ -> presenter.logout() }
.setNegativeButton(android.R.string.no) { dialog, _ -> dialog.cancel() } .setNegativeButton(android.R.string.no) { dialog, _ -> dialog.cancel() }
.create() .create()
.show() .show()
} }
fun setAvatar(avatarUrl: String) { fun setAvatar(avatarUrl: String) {
...@@ -261,36 +262,36 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, ...@@ -261,36 +262,36 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
progressDialog = null progressDialog = null
} }
fun changeLanguage(){ fun changeLanguage() {
val languages = arrayOf("English", "Hindi", "Japanese", "Russian", "Italian") val languages = arrayOf("English", "Hindi", "Japanese", "Russian", "Italian")
val builder = AlertDialog.Builder(this) val builder = AlertDialog.Builder(this)
builder.setTitle("Choose Language") builder.setTitle("Choose Language")
builder.setSingleChoiceItems(languages,-1) { dialog, which -> builder.setSingleChoiceItems(languages, -1) { dialog, which ->
if (which==0){ if (which == 0) {
setLocale("en") setLocale("en")
recreate() recreate()
}else if (which==1){ } else if (which == 1) {
setLocale("hi") setLocale("hi")
recreate() recreate()
}else if (which==2){ } else if (which == 2) {
setLocale("ja") setLocale("ja")
recreate() recreate()
}else if (which==3){ } else if (which == 3) {
setLocale("ru") setLocale("ru")
recreate() recreate()
}else if (which==4){ } else if (which == 4) {
setLocale("it") setLocale("it")
recreate() recreate()
} }
dialog.dismiss() dialog.dismiss()
} }
val mdialog=builder.create() val mdialog = builder.create()
mdialog.show() mdialog.show()
} }
fun setLocale(lang: String) { private fun setLocale(lang: String) {
val locale = Locale(lang) val locale = Locale(lang)
Locale.setDefault(locale) Locale.setDefault(locale)
val config = Configuration() val config = Configuration()
config.locale = locale config.locale = locale
...@@ -301,12 +302,9 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector, ...@@ -301,12 +302,9 @@ class MainActivity : AppCompatActivity(), MainView, HasActivityInjector,
editor.apply() editor.apply()
} }
private fun loadLocale(){ private fun loadLocale() {
val sharedPreferences =getSharedPreferences("settings",Activity.MODE_PRIVATE) val sharedPreferences = getSharedPreferences("Settings", Activity.MODE_PRIVATE)
val language = sharedPreferences.getString("My_Lang","") val language = sharedPreferences.getString("My_Lang", "")
setLocale(language) setLocale(language)
} }
}
\ No newline at end of file
}
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
<string name="msg_delete_message">संदेश को हटाएं</string> <string name="msg_delete_message">संदेश को हटाएं</string>
<string name="msg_delete_description">क्या आप निश्चित रूप से यह संदेश हटाना चाहते हैं</string> <string name="msg_delete_description">क्या आप निश्चित रूप से यह संदेश हटाना चाहते हैं</string>
<string name="msg_welcome_to_rocket_chat">Rocket.Chat में आपका स्वागत है</string> <string name="msg_welcome_to_rocket_chat">Rocket.Chat में आपका स्वागत है</string>
<string name="msg_team_communication">Team Communication</string> <!-- TODO Translate --> <string name="msg_team_communication">टीम संचार</string>
<string name="msg_login_with_email">ई-मेल के साथ लॉगिन करें</string> <string name="msg_login_with_email">ई-मेल के साथ लॉगिन करें</string>
<string name="msg_create_account">खाता बनाएं</string> <string name="msg_create_account">खाता बनाएं</string>
<string name="msg_continue_with_facebook"><b>Facebook</b> के साथ जारी रखें</string> <string name="msg_continue_with_facebook"><b>Facebook</b> के साथ जारी रखें</string>
......
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
<string name="msg_send">Inviare</string> <string name="msg_send">Inviare</string>
<string name="msg_sent_attachment">Inviato allegato</string> <string name="msg_sent_attachment">Inviato allegato</string>
<string name="msg_welcome_to_rocket_chat">Benvenuto in Rocket.Chat </string> <string name="msg_welcome_to_rocket_chat">Benvenuto in Rocket.Chat </string>
<string name="msg_team_communication">Team Communication</string> <!-- TODO Translate --> <string name="msg_team_communication">Comunicazione del team</string>
<string name="msg_login_with_email">Accedi con <b>e-mail</b></string> <string name="msg_login_with_email">Accedi con <b>e-mail</b></string>
<string name="msg_create_account">Crea un utente</string> <string name="msg_create_account">Crea un utente</string>
<string name="msg_continue_with_facebook">Continua con <b>Facebook</b></string> <string name="msg_continue_with_facebook">Continua con <b>Facebook</b></string>
......
...@@ -166,18 +166,12 @@ ...@@ -166,18 +166,12 @@
<string name="msg_view_more">更に表示</string> <string name="msg_view_more">更に表示</string>
<string name="msg_view_less">隠す</string> <string name="msg_view_less">隠す</string>
<string name="msg_muted_on_this_channel">あなたはこのチャンネルでミュートされています</string> <string name="msg_muted_on_this_channel">あなたはこのチャンネルでミュートされています</string>
<<<<<<< HEAD
<string name="msg_no_topic">トピックが追加されていない</string> <string name="msg_no_topic">トピックが追加されていない</string>
<string name="msg_no_announcement">お知らせが追加されていません</string> <string name="msg_no_announcement">お知らせが追加されていません</string>
<string name="msg_no_description">説明が追加されていない</string> <string name="msg_no_description">説明が追加されていない</string>
<!-- TODO - Add proper translation -->
=======
<string name="msg_no_topic">No topic added</string> <!-- TODO Add translation -->
<string name="msg_no_announcement">No announcement added</string> <!-- TODO Add translation -->
<string name="msg_no_description">No description added</string> <!-- TODO Add translation -->
<string name="msg_unable_to_update_password">Unable to update password. Error message: %1$s</string> <!-- TODO - Add proper translation --> <string name="msg_unable_to_update_password">Unable to update password. Error message: %1$s</string> <!-- TODO - Add proper translation -->
<string name="msg_password_updated_successfully">Password updated successfully</string> <!-- TODO - Add proper translation --> <string name="msg_password_updated_successfully">Password updated successfully</string> <!-- TODO - Add proper translation -->
>>>>>>> 04c07f98e16556040c2bf7c827137a9f918e69c7
<plurals name="msg_reacted_with_"> <plurals name="msg_reacted_with_">
<item quantity="one">%1$s reacted with %2$s</item> <!-- TODO - Add proper translation --> <item quantity="one">%1$s reacted with %2$s</item> <!-- TODO - Add proper translation -->
<item quantity="other">%1$s reacted with %2$s</item> <!-- TODO - Add proper translation --> <item quantity="other">%1$s reacted with %2$s</item> <!-- TODO - Add proper translation -->
......
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
<string name="msg_channel_name">Название канала</string> <string name="msg_channel_name">Название канала</string>
<string name="msg_search">Поиск</string> <string name="msg_search">Поиск</string>
<string name="msg_welcome_to_rocket_chat">Rocket.Chat</string> <string name="msg_welcome_to_rocket_chat">Rocket.Chat</string>
<string name="msg_team_communication">Team Communication</string> <!-- TODO Translate --> <string name="msg_team_communication">Коммуникация Команды</string>
<string name="msg_login_with_email">Войти с помощью <b>e-mail</b></string> <string name="msg_login_with_email">Войти с помощью <b>e-mail</b></string>
<string name="msg_create_account">Создать аккаунт</string> <string name="msg_create_account">Создать аккаунт</string>
<string name="msg_continue_with_facebook">Войти с помощью <b>Facebook</b></string> <string name="msg_continue_with_facebook">Войти с помощью <b>Facebook</b></string>
......
...@@ -18,7 +18,7 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin ...@@ -18,7 +18,7 @@ https://github.com/RocketChat/java-code-styles/blob/master/CODING_STYLE.md#strin
<string name="title_share_the_app">Share App</string> <string name="title_share_the_app">Share App</string>
<string name="title_register_username">Register username</string> <string name="title_register_username">Register username</string>
<string name="title_reset_password">Reset password</string> <string name="title_reset_password">Reset password</string>
<string name="title_sign_up">Sign up</string> <string name="title_sign_up" translatable="false">Sign up</string>
<string name="title_authentication">Authentication</string> <string name="title_authentication">Authentication</string>
<string name="title_legal_terms">Legal Terms</string> <string name="title_legal_terms">Legal Terms</string>
<string name="title_chats">Chats</string> <string name="title_chats">Chats</string>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment