From 7161745007d702960e32490b7c065ef8a6a40327 Mon Sep 17 00:00:00 2001 From: EricoMartin Date: Fri, 29 Oct 2021 12:47:48 +0100 Subject: [PATCH 1/5] extract all hard coded strings --- .../app/ui/activities/CreateDialog.kt | 4 +- .../app/ui/settings/SettingsActivity.kt | 46 +++++++++---------- .../app/util/FragmentViewBindingDelegate.kt | 3 +- app/src/main/res/values-ar/strings.xml | 14 ++++++ app/src/main/res/values-de/strings.xml | 14 ++++++ app/src/main/res/values-es/strings.xml | 14 ++++++ app/src/main/res/values-fr/strings.xml | 14 ++++++ app/src/main/res/values-iw/strings.xml | 14 ++++++ app/src/main/res/values-land/strings.xml | 1 + app/src/main/res/values-night/strings.xml | 1 + app/src/main/res/values-pt/strings.xml | 12 +++++ app/src/main/res/values-v23/strings.xml | 1 + app/src/main/res/values-zh/strings.xml | 13 ++++++ app/src/main/res/values/strings.xml | 24 ++++++++++ 14 files changed, 149 insertions(+), 26 deletions(-) diff --git a/app/src/main/java/com/zurichat/app/ui/activities/CreateDialog.kt b/app/src/main/java/com/zurichat/app/ui/activities/CreateDialog.kt index 196aa258..7ecf7c91 100644 --- a/app/src/main/java/com/zurichat/app/ui/activities/CreateDialog.kt +++ b/app/src/main/java/com/zurichat/app/ui/activities/CreateDialog.kt @@ -57,7 +57,7 @@ class CreateDialog(private val layoutInflaterr: LayoutInflater, //save to shared preferences val preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context) val editor = preferences.edit() - editor.putString("name", java.lang.String.valueOf(name.text.toString())) + editor.putString(getString(R.string.name), java.lang.String.valueOf(name.text.toString())) editor.apply() } } @@ -89,7 +89,7 @@ class CreateDialog(private val layoutInflaterr: LayoutInflater, val preferences: SharedPreferences = PreferenceManager.getDefaultSharedPreferences(context) val editor = preferences.edit() - editor.putString("about", java.lang.String.valueOf(about.text.toString())) + editor.putString(getString(R.string.about), java.lang.String.valueOf(about.text.toString())) editor.apply() } } diff --git a/app/src/main/java/com/zurichat/app/ui/settings/SettingsActivity.kt b/app/src/main/java/com/zurichat/app/ui/settings/SettingsActivity.kt index fec4b1fd..094abf8d 100644 --- a/app/src/main/java/com/zurichat/app/ui/settings/SettingsActivity.kt +++ b/app/src/main/java/com/zurichat/app/ui/settings/SettingsActivity.kt @@ -71,7 +71,7 @@ class SettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.OnPrefere } supportActionBar?.setDisplayHomeAsUpEnabled(true) - user = intent.extras?.getParcelable("USER")!! + user = intent.extras?.getParcelable(getString(R.string.user))!! if (!(user.first_name.isEmpty() && user.last_name.isEmpty())){ nameTxt.text = user.first_name.plus(" "+user.last_name) }else if (user.first_name.isNotEmpty()){ @@ -140,15 +140,15 @@ class SettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.OnPrefere override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { setPreferencesFromResource(R.xml.settings_preferences, rootKey) - user = requireActivity().intent.extras?.getParcelable("USER")!! + user = requireActivity().intent.extras?.getParcelable(getString(R.string.user))!! - val chatSettings = findPreference("chat_header") - val securitySettings = findPreference("security_header") - val storageSettings = findPreference("storage_header") - val notificationSettings = findPreference("notification_header") + val chatSettings = findPreference(getString(R.string.chat_header)) + val securitySettings = findPreference(getString(R.string.security_header)) + val storageSettings = findPreference(getString(R.string.storage_header)) + val notificationSettings = findPreference(getString(R.string.notification_header)) val languageSettings = findPreference(getString(R.string.languages)) - val logout = findPreference("logout_header") + val logout = findPreference(getString(R.string.logout_header)) val profileContainer = activity?.findViewById(R.id.profile_container) @@ -164,7 +164,7 @@ class SettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.OnPrefere //make profile container clickable profileContainer?.setOnClickListener { val bundle = Bundle() - bundle.putParcelable("USER",user) + bundle.putParcelable(getString(R.string.user),user) val intent = Intent(requireContext(), ProfileActivity::class.java) intent.putExtras(bundle) startActivity(intent) @@ -249,7 +249,7 @@ class SettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.OnPrefere //logout() val callback: Callback = { logoutUser() } val logoutDialog = LogOutDialogFragment(callback) - logoutDialog.show(childFragmentManager, "LOG_OUT") + logoutDialog.show(childFragmentManager, getString(R.string.logged_out)) true } } @@ -258,7 +258,7 @@ class SettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.OnPrefere userViewModel.logoutResponse.observe(viewLifecycleOwner, { when (it) { is Result.Success -> { - ZuriSharePreference(requireContext()).setString("Current Organization ID","") + ZuriSharePreference(requireContext()).setString(getString(R.string.current_org_id),"") //Toast.makeText(context, "You have been successfully logged out", Toast.LENGTH_SHORT).show() progressLoader.hide() updateUser() @@ -266,7 +266,7 @@ class SettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.OnPrefere startActivity(intent) } is Result.Error -> { - Toast.makeText(requireContext(), "Error", Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), getString(R.string.error), Toast.LENGTH_SHORT).show() progressLoader.hide() } is Result.Loading -> { @@ -329,39 +329,39 @@ class SettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.OnPrefere override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { setPreferencesFromResource(R.xml.notifications_and_sound, rootKey) - val channelTones = findPreference("channel_tones") - val messageTone = findPreference("message_tone") - val vibrate = findPreference("vibrate") - val highPriority = findPreference("high_priority") + val channelTones = findPreference(getString(R.string.channel_tones)) + val messageTone = findPreference(getString(R.string.message_tone)) + val vibrate = findPreference(getString(R.string.vibrate)) + val highPriority = findPreference(getString(R.string.high_priority)) channelTones?.setOnPreferenceChangeListener { preference, newValue -> if (channelTones.isChecked){ isChannelToneChecked = true - Toast.makeText(activity, "Channel tones off", Toast.LENGTH_SHORT).show() + Toast.makeText(activity, getString(R.string.Channel_tones_off), Toast.LENGTH_SHORT).show() }else{ isChannelToneChecked = false - Toast.makeText(activity, "Channel tones on", Toast.LENGTH_SHORT).show() + Toast.makeText(activity, getString(R.string.channel_tones_on), Toast.LENGTH_SHORT).show() } return@setOnPreferenceChangeListener true } messageTone?.setOnPreferenceChangeListener { preference, newValue -> if (messageTone.isChecked){ isMessageToneChecked = true - Toast.makeText(activity, "Message tones off", Toast.LENGTH_SHORT).show() + Toast.makeText(activity, getString(R.string.message_tones_off), Toast.LENGTH_SHORT).show() }else{ isMessageToneChecked = false - Toast.makeText(activity, "Message tones on", Toast.LENGTH_SHORT).show() + Toast.makeText(activity, getString(R.string.message_tones_on), Toast.LENGTH_SHORT).show() } return@setOnPreferenceChangeListener true } vibrate?.setOnPreferenceChangeListener { preference, newValue -> if (vibrate.isChecked){ isVibrateChecked = true - Toast.makeText(activity, "Vibrate off", Toast.LENGTH_SHORT).show() + Toast.makeText(activity, getString(R.string.vibrate_off), Toast.LENGTH_SHORT).show() }else{ isVibrateChecked = false - Toast.makeText(activity, "Vibrate on", Toast.LENGTH_SHORT).show() + Toast.makeText(activity, getString(R.string.vibrate_on), Toast.LENGTH_SHORT).show() vibrateDevice(requireContext()) } return@setOnPreferenceChangeListener true @@ -369,10 +369,10 @@ class SettingsActivity : AppCompatActivity(), PreferenceFragmentCompat.OnPrefere highPriority?.setOnPreferenceChangeListener { preference, newValue -> if (highPriority.isChecked){ isHighPriorityChecked = true - Toast.makeText(activity, "High priority Notifications off", Toast.LENGTH_LONG).show() + Toast.makeText(activity, getString(R.string.high_priority_notification), Toast.LENGTH_LONG).show() }else{ isHighPriorityChecked = false - Toast.makeText(activity, "High priority Notifications on", Toast.LENGTH_LONG).show() + Toast.makeText(activity, getString(R.string.high_priority_notifications_on), Toast.LENGTH_LONG).show() } return@setOnPreferenceChangeListener true } diff --git a/app/src/main/java/com/zurichat/app/util/FragmentViewBindingDelegate.kt b/app/src/main/java/com/zurichat/app/util/FragmentViewBindingDelegate.kt index 703cd815..1d621f79 100644 --- a/app/src/main/java/com/zurichat/app/util/FragmentViewBindingDelegate.kt +++ b/app/src/main/java/com/zurichat/app/util/FragmentViewBindingDelegate.kt @@ -9,6 +9,7 @@ import androidx.lifecycle.Lifecycle import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.Observer import androidx.viewbinding.ViewBinding +import com.zurichat.app.R import kotlin.properties.ReadOnlyProperty import kotlin.reflect.KProperty @@ -53,7 +54,7 @@ class FragmentViewBindingDelegate( val lifecycle = fragment.viewLifecycleOwner.lifecycle if (!lifecycle.currentState.isAtLeast(Lifecycle.State.INITIALIZED)) { - throw IllegalStateException("Should not attempt to get bindings when Fragment views are destroyed.") + throw IllegalStateException(fragment.getString(R.string.fragment_view_destroyed)) } return viewBindingFactory(thisRef.requireView()).also { this.binding = it } diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 50fc34f0..64566108 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -258,4 +258,18 @@ البرتغالية أضف مساحة العمل قم بإنشاء مساحة عمل جديدة + Error + channel_tones + message_tone + vibrate + Channel tones off + Channel tones on + Message tones off + Message tones on + Vibrate off + Vibrate on + High priority Notifications off + Should not attempt to get bindings when Fragment views are destroyed. + name + about \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 1ac17973..39c4e28d 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -266,4 +266,18 @@ Team Tolstoi - Portugiesisch Arbeitsbereich hinzufügen Neuen Arbeitsbereich erstellen + Error + channel_tones + message_tone + vibrate + Channel tones off + Channel tones on + Message tones off + Message tones on + Vibrate off + Vibrate on + High priority Notifications off + Should not attempt to get bindings when Fragment views are destroyed. + name + about diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index bd00a262..bf416128 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -257,5 +257,19 @@ no podrás ver lo último visto de otras personas portugués Agregar espacio de trabajo Crear nuevo espacio de trabajo + Error + channel_tones + message_tone + vibrate + Channel tones off + Channel tones on + Message tones off + Message tones on + Vibrate off + Vibrate on + High priority Notifications off + Should not attempt to get bindings when Fragment views are destroyed. + name + about diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 4027fb88..98d2a06f 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -258,4 +258,18 @@ Portugais Ajouter un espace de travail Créer un nouvel espace de travail + Error + channel_tones + message_tone + vibrate + Channel tones off + Channel tones on + Message tones off + Message tones on + Vibrate off + Vibrate on + High priority Notifications off + Should not attempt to get bindings when Fragment views are destroyed. + name + about \ No newline at end of file diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml index 5a6aa35a..783726fb 100644 --- a/app/src/main/res/values-iw/strings.xml +++ b/app/src/main/res/values-iw/strings.xml @@ -281,4 +281,18 @@ פורטוגזית הוסף סביבת עבודה צור סביבת עבודה חדשה + Error + channel_tones + message_tone + vibrate + Channel tones off + Channel tones on + Message tones off + Message tones on + Vibrate off + Vibrate on + High priority Notifications off + Should not attempt to get bindings when Fragment views are destroyed. + name + about \ No newline at end of file diff --git a/app/src/main/res/values-land/strings.xml b/app/src/main/res/values-land/strings.xml index f5623370..abb4bb76 100644 --- a/app/src/main/res/values-land/strings.xml +++ b/app/src/main/res/values-land/strings.xml @@ -1,4 +1,5 @@ Unread messages + Error \ No newline at end of file diff --git a/app/src/main/res/values-night/strings.xml b/app/src/main/res/values-night/strings.xml index f5623370..abb4bb76 100644 --- a/app/src/main/res/values-night/strings.xml +++ b/app/src/main/res/values-night/strings.xml @@ -1,4 +1,5 @@ Unread messages + Error \ No newline at end of file diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index c9086a52..46e3fc78 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -258,4 +258,16 @@ Português Adicionar Espaço de Trabalho Criar novo espaço de trabalho + channel_tones + message_tone + vibrate + Channel tones off + Channel tones on + Message tones off + Message tones on + Vibrate off + Vibrate on + High priority Notifications off + Should not attempt to get bindings when Fragment views are destroyed. + about \ No newline at end of file diff --git a/app/src/main/res/values-v23/strings.xml b/app/src/main/res/values-v23/strings.xml index f5623370..0d50e662 100644 --- a/app/src/main/res/values-v23/strings.xml +++ b/app/src/main/res/values-v23/strings.xml @@ -1,4 +1,5 @@ Unread messages + name \ No newline at end of file diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 5d7f1751..c9053b14 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -269,4 +269,17 @@ Team Tolstoy - 葡萄牙语 添加工作区 创建新工作区 + channel_tones + message_tone + vibrate + Channel tones off + Channel tones on + Message tones off + Message tones on + Vibrate off + Vibrate on + High priority Notifications off + Should not attempt to get bindings when Fragment views are destroyed. + name + about \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 603be953..c412cd6d 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -301,4 +301,28 @@ Portuguese Add Workspace Create New Workspace + chat_header + security_header + storage_header + notification_header + logout_header + USER + LOG_OUT + Current Organization ID + Error + channel_tones + message_tone + vibrate + high_priority + Channel tones off + Channel tones on + Message tones off + Message tones on + Vibrate off + Vibrate on + High priority Notifications off + High priority Notifications on + Should not attempt to get bindings when Fragment views are destroyed. + name + about From 9ad352c09efc4d21f21b266551b75b385017c87d Mon Sep 17 00:00:00 2001 From: EricoMartin Date: Fri, 29 Oct 2021 20:19:52 +0100 Subject: [PATCH 2/5] localize string resources --- .../ui/activities/DocumentSentActivity.java | 2 +- .../app/ui/activities/MainActivity.kt | 6 +- .../app/ui/activities/OpenCameraActivity.java | 2 +- .../app/ui/activities/ProfileActivity.kt | 10 +-- .../zurichat/app/ui/audio/AudiosActivity.java | 8 +- .../java/com/zurichat/app/ui/dm/DMFragment.kt | 4 +- .../ui/dm/dm_notification/DMWorkerUtils.kt | 2 +- .../app/ui/dm_chat/fragment/RoomFragment.kt | 6 -- .../app/ui/documents/DocumentActivity.java | 8 +- .../channel_chat/ChannelChatFragment.kt | 2 +- .../chats_and_channels/ChannelsFragment.kt | 4 +- .../switch_account/AccountsFragment.kt | 2 +- .../switch_account/ChangePassFragment.kt | 16 ++-- .../switch_account/EnterOtpACFragment.kt | 6 +- .../switch_account/ForgetAccountPassword.kt | 12 +-- .../zurichat/app/ui/login/LoginActivity.kt | 2 +- .../zurichat/app/ui/login/LoginViewModel.kt | 16 ++-- .../fragment/NewChannelDataFragment.kt | 2 +- .../fragment/SelectMemberFragment.kt | 5 +- .../fragment/SelectNewChannelFragment.kt | 4 +- .../NewChannelWorkerUtils.kt | 2 +- .../ui/organizations/AddByEmailFragment.kt | 6 +- .../app/ui/organizations/NextFragment.kt | 4 +- .../app/ui/organizations/ShareLinkFragment.kt | 2 +- .../ui/SwitchOrganizationFragment.kt | 8 +- .../app/ui/settings/ChatBackupActivity.kt | 5 +- .../app/ui/settings/LargerItemsActivity.kt | 4 +- .../app/ui/settings/WallpaperActivity.kt | 6 +- .../dialogs/BackUpGoogleDialogFragment.kt | 2 +- .../dialogs/BackUpOverDialogFragment.kt | 2 +- .../app/ui/settings/fragments/ChatFragment.kt | 2 +- .../fragments/ChooseWallpaperCategory.kt | 2 +- app/src/main/res/values-ar/strings.xml | 78 ++++++++++++++---- app/src/main/res/values-de/strings.xml | 79 ++++++++++++++---- app/src/main/res/values-es/strings.xml | 81 ++++++++++++++---- app/src/main/res/values-fr/strings.xml | 78 ++++++++++++++---- app/src/main/res/values-it/strings.xml | 64 +++++++++++++++ app/src/main/res/values-iw/strings.xml | 82 +++++++++++++++---- app/src/main/res/values-pt/strings.xml | 77 ++++++++++++++--- app/src/main/res/values-zh/strings.xml | 68 ++++++++++++++- app/src/main/res/values/strings.xml | 69 +++++++++++++--- 41 files changed, 662 insertions(+), 178 deletions(-) diff --git a/app/src/main/java/com/zurichat/app/ui/activities/DocumentSentActivity.java b/app/src/main/java/com/zurichat/app/ui/activities/DocumentSentActivity.java index 4b7a0d88..ea49a4ac 100644 --- a/app/src/main/java/com/zurichat/app/ui/activities/DocumentSentActivity.java +++ b/app/src/main/java/com/zurichat/app/ui/activities/DocumentSentActivity.java @@ -143,7 +143,7 @@ private void startrecord() { try { mediaRecorder.prepare(); mediaRecorder.start(); - Toast.makeText(DocumentSentActivity.this, "recording", Toast.LENGTH_SHORT).show(); + Toast.makeText(DocumentSentActivity.this, getString(R.string.recording), Toast.LENGTH_SHORT).show(); }catch (Exception e){ e.printStackTrace(); // Toast.makeText(MainActivity.this, "recording error", Toast.LENGTH_SHORT).show(); diff --git a/app/src/main/java/com/zurichat/app/ui/activities/MainActivity.kt b/app/src/main/java/com/zurichat/app/ui/activities/MainActivity.kt index 74491465..c872ff31 100644 --- a/app/src/main/java/com/zurichat/app/ui/activities/MainActivity.kt +++ b/app/src/main/java/com/zurichat/app/ui/activities/MainActivity.kt @@ -66,9 +66,9 @@ class MainActivity : AppCompatActivity() { val requestPermissionLauncher = registerForActivityResult(ActivityResultContracts.RequestPermission()) { isGranted: Boolean -> //Shows Toast message if permission is granted or denied. if (isGranted) { - Toast.makeText(this, "Permission Granted!", Toast.LENGTH_LONG).show() + Toast.makeText(this, getString(R.string.permission_granted), Toast.LENGTH_LONG).show() } else { - Toast.makeText(this, "Permission Denied!", Toast.LENGTH_LONG).show() + Toast.makeText(this, getString(R.string.permission_denied), Toast.LENGTH_LONG).show() } } @@ -96,7 +96,7 @@ class MainActivity : AppCompatActivity() { val isConnected: Boolean = activeNetwork?.isConnectedOrConnecting == true if(!isConnected){ - Toast.makeText(applicationContext,"No Internet Connection!",Toast.LENGTH_LONG).show() + Toast.makeText(applicationContext,getString(R.string.hello_blank_fragment),Toast.LENGTH_LONG).show() } } diff --git a/app/src/main/java/com/zurichat/app/ui/activities/OpenCameraActivity.java b/app/src/main/java/com/zurichat/app/ui/activities/OpenCameraActivity.java index adecb579..e826a62b 100644 --- a/app/src/main/java/com/zurichat/app/ui/activities/OpenCameraActivity.java +++ b/app/src/main/java/com/zurichat/app/ui/activities/OpenCameraActivity.java @@ -45,7 +45,7 @@ protected void onCreate(Bundle savedInstanceState) { if (intent.resolveActivity(getPackageManager()) != null){ activityResultLauncher.launch(intent); }else{ - Toast.makeText(OpenCameraActivity.this, "Unable to Start Camera!", + Toast.makeText(OpenCameraActivity.this, getString(R.string.unable_to_start_camera), Toast.LENGTH_SHORT).show(); } }); diff --git a/app/src/main/java/com/zurichat/app/ui/activities/ProfileActivity.kt b/app/src/main/java/com/zurichat/app/ui/activities/ProfileActivity.kt index 7ce75d2b..96f9e206 100644 --- a/app/src/main/java/com/zurichat/app/ui/activities/ProfileActivity.kt +++ b/app/src/main/java/com/zurichat/app/ui/activities/ProfileActivity.kt @@ -69,7 +69,7 @@ open class ProfileActivity: AppCompatActivity() { //user = intent.extras?.getParcelable("USER")!! - user = intent.getParcelableExtra("USER") as User + user = intent.getParcelableExtra(getString(R.string.user)) as User setContentView(R.layout.activity_profile) token = user?.token @@ -154,8 +154,8 @@ open class ProfileActivity: AppCompatActivity() { val phoneTextView = findViewById(R.id.tv_phoneno) with(builder){ - setTitle("Edit Phone Number") - setPositiveButton("Save"){ _, _ -> + setTitle(getString(R.string.edit_number)) + setPositiveButton(getString(R.string.save)){ _, _ -> phoneTextView.text = editText.text.toString() // populates the value of the @@ -169,7 +169,7 @@ open class ProfileActivity: AppCompatActivity() { editor.apply() } - setNegativeButton("Cancel") { _, _ -> + setNegativeButton(getString(R.string.cancel_mute_channel_settings)) { _, _ -> Timber.d("This button clicked successfully!!") //just for log purposes } setView(dialogLayout) @@ -196,7 +196,7 @@ open class ProfileActivity: AppCompatActivity() { //set profile photo to image uri profilePhoto.setImageURI(uri) profilePhoto.invalidate() - Toast.makeText(this, "Update Successful", Toast.LENGTH_SHORT).show() + Toast.makeText(this, getString(R.string.successful), Toast.LENGTH_SHORT).show() updateProfilePhoto(uri) } } diff --git a/app/src/main/java/com/zurichat/app/ui/audio/AudiosActivity.java b/app/src/main/java/com/zurichat/app/ui/audio/AudiosActivity.java index 84f44dbb..a1843eb0 100644 --- a/app/src/main/java/com/zurichat/app/ui/audio/AudiosActivity.java +++ b/app/src/main/java/com/zurichat/app/ui/audio/AudiosActivity.java @@ -67,15 +67,15 @@ private void sendAudio() { @java.lang.Override public void onResponse(Call call, Response response) { if(response.isSuccessful()){ - Toast.makeText(AudiosActivity.this, "Sent Successfully", Toast.LENGTH_SHORT).show(); + Toast.makeText(AudiosActivity.this, getString(R.string.sent_successfully), Toast.LENGTH_SHORT).show(); }else if (response.code() == 400){ - Toast.makeText(AudiosActivity.this, "Error 400, invalid", Toast.LENGTH_SHORT).show(); + Toast.makeText(AudiosActivity.this, getString(R.string.invalid_error), Toast.LENGTH_SHORT).show(); }else if (response.code() == 404){ - Toast.makeText(AudiosActivity.this, "Error 404, Not found", Toast.LENGTH_SHORT).show(); + Toast.makeText(AudiosActivity.this, getString(R.string.not_found_error), Toast.LENGTH_SHORT).show(); }else if (response.code() == 401){ - Toast.makeText(AudiosActivity.this, "Error 400, invalid", Toast.LENGTH_SHORT).show(); + Toast.makeText(AudiosActivity.this, getString(R.string.invalid_error), Toast.LENGTH_SHORT).show(); } } diff --git a/app/src/main/java/com/zurichat/app/ui/dm/DMFragment.kt b/app/src/main/java/com/zurichat/app/ui/dm/DMFragment.kt index e813c877..9b16b2d2 100644 --- a/app/src/main/java/com/zurichat/app/ui/dm/DMFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/dm/DMFragment.kt @@ -83,7 +83,7 @@ class DMFragment : Fragment(R.layout.fragment_dm) { senderId = roomList.room_user_ids.last() binding.iconBtn.setOnClickListener { - Toast.makeText(context, "Show Emoji", Toast.LENGTH_LONG).show() + Toast.makeText(context, getString(R.string.show_emoji), Toast.LENGTH_LONG).show() } // arguments?.let { bundle -> @@ -202,7 +202,7 @@ class DMFragment : Fragment(R.layout.fragment_dm) { when (imageResult) { is ImageResult.Success -> handleAttachmentUpload(listOf(imageResult.value)) is ImageResult.Failure -> { - Toast.makeText(requireContext(), "Picture not taken", Toast.LENGTH_LONG).show() + Toast.makeText(requireContext(), getString(R.string.picture_not_taken), Toast.LENGTH_LONG).show() } } } diff --git a/app/src/main/java/com/zurichat/app/ui/dm/dm_notification/DMWorkerUtils.kt b/app/src/main/java/com/zurichat/app/ui/dm/dm_notification/DMWorkerUtils.kt index 33975507..d2715b8c 100644 --- a/app/src/main/java/com/zurichat/app/ui/dm/dm_notification/DMWorkerUtils.kt +++ b/app/src/main/java/com/zurichat/app/ui/dm/dm_notification/DMWorkerUtils.kt @@ -35,7 +35,7 @@ fun makeNotification(context: Context, message: String) { val notification = NotificationCompat.Builder(context, CHANNEL_ID) .setContentText(message) .setAutoCancel(true) - .setContentTitle("New message") + .setContentTitle(context.getString(R.string.new_message)) .setPriority(NotificationCompat.PRIORITY_HIGH) .setSmallIcon(R.drawable.notifications_icon) .setContentIntent(pendingIntent) diff --git a/app/src/main/java/com/zurichat/app/ui/dm_chat/fragment/RoomFragment.kt b/app/src/main/java/com/zurichat/app/ui/dm_chat/fragment/RoomFragment.kt index e50f20b6..676e6bfd 100644 --- a/app/src/main/java/com/zurichat/app/ui/dm_chat/fragment/RoomFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/dm_chat/fragment/RoomFragment.kt @@ -3,8 +3,6 @@ package com.zurichat.app.ui.dm_chat.fragment import android.content.Context import android.content.SharedPreferences import android.os.Bundle -import android.os.Handler -import android.os.Looper import android.text.format.DateUtils import android.util.Log import android.view.LayoutInflater @@ -29,16 +27,12 @@ import com.zurichat.app.models.User import com.zurichat.app.ui.add_channel.BaseItem import com.zurichat.app.ui.add_channel.BaseListAdapter import com.zurichat.app.ui.dm.MEDIA -import com.zurichat.app.ui.dm_chat.apiservice.ApiDMService import com.zurichat.app.ui.dm_chat.model.request.SendMessageBody import com.zurichat.app.ui.dm_chat.model.response.message.BaseRoomData import com.zurichat.app.ui.dm_chat.model.response.message.Data -import com.zurichat.app.ui.dm_chat.model.response.message.Result import com.zurichat.app.ui.dm_chat.model.response.message.SendMessageResponse import com.zurichat.app.ui.dm_chat.model.response.room.RoomsListResponseItem -import com.zurichat.app.ui.dm_chat.repository.Repository import com.zurichat.app.ui.dm_chat.viewmodel.RoomViewModel -import com.zurichat.app.ui.dm_chat.viewmodel.RoomViewModelFactory import com.zurichat.app.ui.fragments.channel_chat.ChannelHeaderItem import com.zurichat.app.ui.fragments.home_screen.CentrifugeClient import com.zurichat.app.util.isInternetAvailable diff --git a/app/src/main/java/com/zurichat/app/ui/documents/DocumentActivity.java b/app/src/main/java/com/zurichat/app/ui/documents/DocumentActivity.java index 976f5cef..3d44112b 100644 --- a/app/src/main/java/com/zurichat/app/ui/documents/DocumentActivity.java +++ b/app/src/main/java/com/zurichat/app/ui/documents/DocumentActivity.java @@ -80,15 +80,15 @@ private void sendDocument() { @java.lang.Override public void onResponse(Call call, Response response) { if(response.isSuccessful()){ - Toast.makeText(DocumentActivity.this, "Sent Successfully", Toast.LENGTH_SHORT).show(); + Toast.makeText(DocumentActivity.this, getString(R.string.successful), Toast.LENGTH_SHORT).show(); }else if (response.code() == 400){ - Toast.makeText(DocumentActivity.this, "Error 400, invalid", Toast.LENGTH_SHORT).show(); + Toast.makeText(DocumentActivity.this, getString(R.string.invalid_error), Toast.LENGTH_SHORT).show(); }else if (response.code() == 404){ - Toast.makeText(DocumentActivity.this, "Error 404, Not found", Toast.LENGTH_SHORT).show(); + Toast.makeText(DocumentActivity.this, getString(R.string.not_found_error), Toast.LENGTH_SHORT).show(); }else if (response.code() == 401){ - Toast.makeText(DocumentActivity.this, "Error 400, invalid", Toast.LENGTH_SHORT).show(); + Toast.makeText(DocumentActivity.this, getString(R.string.invalid_error), Toast.LENGTH_SHORT).show(); } } diff --git a/app/src/main/java/com/zurichat/app/ui/fragments/channel_chat/ChannelChatFragment.kt b/app/src/main/java/com/zurichat/app/ui/fragments/channel_chat/ChannelChatFragment.kt index 6734abfb..015b5b91 100644 --- a/app/src/main/java/com/zurichat/app/ui/fragments/channel_chat/ChannelChatFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/fragments/channel_chat/ChannelChatFragment.kt @@ -237,7 +237,7 @@ class ChannelChatFragment : Fragment() { //sendVoiceNote.visibility = View.VISIBLE dimmerBox.visibility = View.GONE toolbar.subtitle = channel.members.plus(1).toString().plus(" Members") - Toast.makeText(requireContext(), "Joined Channel Successfully", Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), getString(R.string.join_channel_success), Toast.LENGTH_SHORT).show() binding.channelJoinBar.visibility = View.GONE channelJoined = true } else { diff --git a/app/src/main/java/com/zurichat/app/ui/fragments/home_screen/chats_and_channels/ChannelsFragment.kt b/app/src/main/java/com/zurichat/app/ui/fragments/home_screen/chats_and_channels/ChannelsFragment.kt index 41549602..8ad650d5 100644 --- a/app/src/main/java/com/zurichat/app/ui/fragments/home_screen/chats_and_channels/ChannelsFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/fragments/home_screen/chats_and_channels/ChannelsFragment.kt @@ -336,8 +336,8 @@ class ChannelsFragment : Fragment(R.layout.fragment_channels) { private fun showSnackBar() { val view: View = CoordinatorLayout(requireContext()) - val snack = Snackbar.make(view, "An Error Occurred!", Snackbar.LENGTH_INDEFINITE) - snack.setAction("Retry") { + val snack = Snackbar.make(view, getString(R.string.an_error_occured), Snackbar.LENGTH_INDEFINITE) + snack.setAction(getString(R.string.retry)) { viewModel.getChannelsList(organizationID) } snack.show() diff --git a/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/AccountsFragment.kt b/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/AccountsFragment.kt index d7770bcd..236b374d 100644 --- a/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/AccountsFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/AccountsFragment.kt @@ -54,7 +54,7 @@ class AccountsFragment : Fragment() { if (!user.isNullOrEmpty())textView.visibility = View.GONE adapter.setData(user) if (user.isNotEmpty()){ - toolbar.subtitle = user.size.toString()+ " Account(s)" + toolbar.subtitle = user.size.toString()+ getString(R.string.accts) } }) diff --git a/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/ChangePassFragment.kt b/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/ChangePassFragment.kt index 4a4ca505..e929af52 100644 --- a/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/ChangePassFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/ChangePassFragment.kt @@ -58,10 +58,10 @@ class ChangePassFragment: Fragment(R.layout.fragment_confirm_password) { val newPassFld = binding.textEditNewpass val confPassFld = binding.textEditConfirmpassWord if (newPassFld.text.toString()==confPassFld.text.toString()){ - Toast.makeText(requireContext(), "Password match", Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), getString(R.string.password_match), Toast.LENGTH_SHORT).show() updatePass(newPassFld.text.toString()) }else if (newPassFld.text.toString()!=confPassFld.text.toString()){ - binding.textEditNewpass.error = "Password doesn't match" + binding.textEditNewpass.error = getString(R.string.password_not_match) } } @@ -83,19 +83,19 @@ class ChangePassFragment: Fragment(R.layout.fragment_confirm_password) { userViewModel.deleteUser(args.account) val action = ChangePassFragmentDirections.actionChangePassFragmentToLoginActivity() - Toast.makeText(requireContext(), "password change successful\n Fresh sign in required", + Toast.makeText(requireContext(), getString(R.string.fresh_sign_in), Toast.LENGTH_SHORT).show() findNavController().navigate(action) requireActivity().finish() } private fun updateError(throwable: Throwable){ - Toast.makeText(requireContext(), "Please try again", Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), getString(R.string.please_try_again), Toast.LENGTH_SHORT).show() Timber.e(throwable) } private fun handleLoading(){ - Toast.makeText(requireContext(), "Please wait", Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), getString(R.string.pls_wait), Toast.LENGTH_SHORT).show() } //update user state in database @@ -119,16 +119,16 @@ class ChangePassFragment: Fragment(R.layout.fragment_confirm_password) { when (it) { is Result.Success -> { Toast.makeText(context, - "You have been successfully logged out of previous account", + getString(R.string.log_out_success), Toast.LENGTH_SHORT).show() updateUser() logoutSuccess() } is Result.Error -> { - Toast.makeText(context, "Error", Toast.LENGTH_SHORT).show() + Toast.makeText(context, getString(R.string.error), Toast.LENGTH_SHORT).show() } is Result.Loading -> { - Toast.makeText(context, "Loading", Toast.LENGTH_SHORT).show() + Toast.makeText(context, getString(R.string.loading), Toast.LENGTH_SHORT).show() } } }) diff --git a/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/EnterOtpACFragment.kt b/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/EnterOtpACFragment.kt index 6bd07129..8fb3eb2b 100644 --- a/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/EnterOtpACFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/EnterOtpACFragment.kt @@ -62,7 +62,7 @@ class EnterOtpACFragment:Fragment(R.layout.fragment_enter_otp) { } private fun resetSuccess(){ - Toast.makeText(requireContext(), "correct code", Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), getString(R.string.correct_code), Toast.LENGTH_SHORT).show() val otpCode = binding.pinView.text.toString() val action = EnterOtpACFragmentDirections .actionEnterOtpACFragmentToChangePassFragment(args.account,otpCode,args.curUser) @@ -70,12 +70,12 @@ class EnterOtpACFragment:Fragment(R.layout.fragment_enter_otp) { } private fun resetError(throwable: Throwable){ - Toast.makeText(requireContext(), "Wrong code try again", Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), getString(R.string.wrong_code_retry), Toast.LENGTH_SHORT).show() Timber.e(throwable) } private fun handleLoading() { - Toast.makeText(context, "Please wait", Toast.LENGTH_LONG).show() + Toast.makeText(context, getString(R.string.pls_wait), Toast.LENGTH_LONG).show() } } \ No newline at end of file diff --git a/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/ForgetAccountPassword.kt b/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/ForgetAccountPassword.kt index 048b4342..6f8d9b8e 100644 --- a/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/ForgetAccountPassword.kt +++ b/app/src/main/java/com/zurichat/app/ui/fragments/switch_account/ForgetAccountPassword.kt @@ -40,10 +40,10 @@ class ForgetAccountPassword : Fragment(R.layout.fragment_forget_account_pass) { success(message) } is Result.Error -> { - Toast.makeText(requireContext(), "please try again", Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), getString(R.string.please_try_again), Toast.LENGTH_SHORT).show() } is Result.Loading ->{ - Toast.makeText(requireContext(), "please wait", Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), getString(R.string.pls_wait), Toast.LENGTH_SHORT).show() } } }) @@ -51,12 +51,12 @@ class ForgetAccountPassword : Fragment(R.layout.fragment_forget_account_pass) { private fun dialogue (){ MaterialAlertDialogBuilder(requireContext()) - .setTitle("Confirmation ") - .setMessage("Are you sure you want to reset the password for this account?") - .setNegativeButton("No"){dialog,which-> + .setTitle(getString(R.string.confirm)) + .setMessage(getString(R.string.sure_reset_password)) + .setNegativeButton(getString(R.string.no)){dialog,which-> } - .setPositiveButton("Yes"){dialog,which-> + .setPositiveButton(getString(R.string.yes)){dialog,which-> viewModel.passwordReset(PasswordResetBody(args.account.email)) } .show() diff --git a/app/src/main/java/com/zurichat/app/ui/login/LoginActivity.kt b/app/src/main/java/com/zurichat/app/ui/login/LoginActivity.kt index 6dc13ee8..9bd1927b 100644 --- a/app/src/main/java/com/zurichat/app/ui/login/LoginActivity.kt +++ b/app/src/main/java/com/zurichat/app/ui/login/LoginActivity.kt @@ -56,7 +56,7 @@ class LoginActivity : AppCompatActivity() { val isConnected: Boolean = activeNetwork?.isConnectedOrConnecting == true if(!isConnected){ - Toast.makeText(applicationContext,"No Internet Connection!",Toast.LENGTH_LONG).show() + Toast.makeText(applicationContext,getString(R.string.hello_blank_fragment),Toast.LENGTH_LONG).show() /*val ft = supportFragmentManager.beginTransaction() ft.replace(R.id.fragment_placeholder, InternetFragment()) ft.commit()*/ diff --git a/app/src/main/java/com/zurichat/app/ui/login/LoginViewModel.kt b/app/src/main/java/com/zurichat/app/ui/login/LoginViewModel.kt index 49d114a3..bcccf674 100644 --- a/app/src/main/java/com/zurichat/app/ui/login/LoginViewModel.kt +++ b/app/src/main/java/com/zurichat/app/ui/login/LoginViewModel.kt @@ -1,6 +1,8 @@ package com.zurichat.app.ui.login +import android.app.Application import androidx.lifecycle.* +import com.zurichat.app.R import com.zurichat.app.data.repository.UserRepository import com.zurichat.app.models.* import com.zurichat.app.ui.login.password.confirm.ConfirmPasswordData @@ -15,7 +17,7 @@ import javax.inject.Inject import kotlinx.coroutines.Dispatchers @HiltViewModel -class LoginViewModel @Inject constructor(private val repository: UserRepository) : ViewModel() { +class LoginViewModel @Inject constructor(private val repository: UserRepository) : AndroidViewModel(Application()) { private val _loginResponse = MutableLiveData>() @@ -72,7 +74,8 @@ class LoginViewModel @Inject constructor(private val repository: UserRepository) _logoutResponse.postValue(Result.Success(it)) } }else { - _logoutResponse.postValue(Result.Error(Exception("Error occurred please try again "))) + _logoutResponse.postValue(Result.Error(Exception(getApplication().resources.getString( + R.string.err_occured_try_again)))) } } } @@ -89,7 +92,8 @@ class LoginViewModel @Inject constructor(private val repository: UserRepository) } } else { - _resetCodeResponse.postValue(Result.Error(Exception("Error occurred please try again "))) + _resetCodeResponse.postValue(Result.Error(Exception(getApplication().resources.getString( + R.string.err_occured_try_again)))) } } @@ -108,7 +112,8 @@ class LoginViewModel @Inject constructor(private val repository: UserRepository) } else { _updatePassResponse.postValue(Result - .Error(Exception("Error occurred please try again "))) + .Error(Exception(getApplication().resources.getString( + R.string.err_occured_try_again)))) } } @@ -125,7 +130,8 @@ class LoginViewModel @Inject constructor(private val repository: UserRepository) _passwordReset.postValue(Result.Success(it)) } }else{ - _passwordReset.postValue(Result.Error(Exception("ERROR MESSAGE"))) + _passwordReset.postValue(Result.Error(Exception(getApplication().resources.getString( + R.string.err_msg)))) } } diff --git a/app/src/main/java/com/zurichat/app/ui/newchannel/fragment/NewChannelDataFragment.kt b/app/src/main/java/com/zurichat/app/ui/newchannel/fragment/NewChannelDataFragment.kt index 2a6bd842..3182c0e3 100644 --- a/app/src/main/java/com/zurichat/app/ui/newchannel/fragment/NewChannelDataFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/newchannel/fragment/NewChannelDataFragment.kt @@ -259,7 +259,7 @@ class NewChannelDataFragment : Fragment(R.layout.fragment_new_channel_data) { bundle.putBoolean("Channel Joined", true) if (binding.channelName.text!!.isEmpty()) { - binding.channelName.error = "Channel name can't be empty." + binding.channelName.error = getString(R.string.channel_name_not_empty) } else { try { findNavController().navigate(R.id.channelChatFragment, diff --git a/app/src/main/java/com/zurichat/app/ui/newchannel/fragment/SelectMemberFragment.kt b/app/src/main/java/com/zurichat/app/ui/newchannel/fragment/SelectMemberFragment.kt index 5c350883..754a374b 100644 --- a/app/src/main/java/com/zurichat/app/ui/newchannel/fragment/SelectMemberFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/newchannel/fragment/SelectMemberFragment.kt @@ -103,13 +103,14 @@ class SelectMemberFragment : Fragment(R.layout.fragment_select_member) { if (it.isEmpty()) { binding.topRecyclerView.visibility = View.GONE binding.fabAddChannel.visibility = View.GONE - binding.toolbar.subtitle = "Choose Channel Members" + binding.toolbar.subtitle = getString(R.string.choose_channel_members) } else { binding.topRecyclerView.visibility = View.VISIBLE binding.fabAddChannel.visibility = View.VISIBLE selectedMemberAdapter.selectedUserList = it selectedMemberAdapter.notifyDataSetChanged() - binding.toolbar.subtitle = "${selectedUsers.size} out of ${userList.size} selected" + binding.toolbar.subtitle = "${selectedUsers.size}" + getString(R.string.out_of) + "${userList.size}" + getString( + R.string.selected) binding.topRecyclerView.smoothScrollToPosition(selectedUsers.size - 1) } diff --git a/app/src/main/java/com/zurichat/app/ui/newchannel/fragment/SelectNewChannelFragment.kt b/app/src/main/java/com/zurichat/app/ui/newchannel/fragment/SelectNewChannelFragment.kt index 8549dbae..3628bfc1 100644 --- a/app/src/main/java/com/zurichat/app/ui/newchannel/fragment/SelectNewChannelFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/newchannel/fragment/SelectNewChannelFragment.kt @@ -66,7 +66,7 @@ class SelectNewChannelFragment : Fragment(R.layout.fragment_select_new_channel) progressDialog.dismiss() }catch (e:Exception){ - Toast.makeText(requireContext(), "an error occurred please try again later", Toast.LENGTH_SHORT).show() + Toast.makeText(requireContext(), getString(R.string.err_occured_try_again), Toast.LENGTH_SHORT).show() progressDialog.dismiss() } @@ -213,7 +213,7 @@ class SelectNewChannelFragment : Fragment(R.layout.fragment_select_new_channel) viewModel._endPointResult.collect { endPointLoadingState = it if ( it is SelectNewChannelViewState.Error) { - Toast.makeText(requireContext(),"Error in Loading data from server", Toast.LENGTH_LONG).show() + Toast.makeText(requireContext(),getString(R.string.err_loading_data), Toast.LENGTH_LONG).show() } } } diff --git a/app/src/main/java/com/zurichat/app/ui/newchannel/newchannel_notification/NewChannelWorkerUtils.kt b/app/src/main/java/com/zurichat/app/ui/newchannel/newchannel_notification/NewChannelWorkerUtils.kt index 0725638f..10bf7f36 100644 --- a/app/src/main/java/com/zurichat/app/ui/newchannel/newchannel_notification/NewChannelWorkerUtils.kt +++ b/app/src/main/java/com/zurichat/app/ui/newchannel/newchannel_notification/NewChannelWorkerUtils.kt @@ -35,7 +35,7 @@ fun makeNotification(context: Context, message: String) { val notification = NotificationCompat.Builder(context, CHANNEL_ID) .setContentText(message) .setAutoCancel(true) - .setContentTitle("New channel") + .setContentTitle(context.getString(R.string.new_channel)) .setPriority(NotificationCompat.PRIORITY_HIGH) .setSmallIcon(R.drawable.notifications_icon) .setContentIntent(pendingIntent) diff --git a/app/src/main/java/com/zurichat/app/ui/organizations/AddByEmailFragment.kt b/app/src/main/java/com/zurichat/app/ui/organizations/AddByEmailFragment.kt index 00dfcbba..b9b0464c 100644 --- a/app/src/main/java/com/zurichat/app/ui/organizations/AddByEmailFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/organizations/AddByEmailFragment.kt @@ -48,7 +48,7 @@ class AddByEmailFragment : Fragment(R.layout.fragment_add_by_email) { val toolbar = binding.toolbarContainer.toolbar progressDialog = ProgressDialog(context) - toolbar.title = "Invite By Email" + toolbar.title = getString(R.string.invite_by_email) toolbar.subtitle = organizationName binding.toolbarContainer.toolbar.setLogo(drawable.ic_back) val logoView = toolbar.getChildAt(1) @@ -84,7 +84,7 @@ class AddByEmailFragment : Fragment(R.layout.fragment_add_by_email) { list.add(recipientEmail.email) } if (list.size == 0){ - binding.recipientEmailEdit.setError("You must at least add one email") + binding.recipientEmailEdit.setError(getString(R.string.add_one_email)) }else{ val sendInviteBody = SentInviteBody(list) val call = apiService.sendInvite(organizationId, sendInviteBody) @@ -96,7 +96,7 @@ class AddByEmailFragment : Fragment(R.layout.fragment_add_by_email) { response: Response ) { if (response.code() == 200) { - Toast.makeText(context, "Invitation sent successfully", Toast.LENGTH_SHORT) + Toast.makeText(context, getString(R.string.invite_sent_succesfully), Toast.LENGTH_SHORT) .show() val bundle = bundleOf( "organizationId" to organizationId, diff --git a/app/src/main/java/com/zurichat/app/ui/organizations/NextFragment.kt b/app/src/main/java/com/zurichat/app/ui/organizations/NextFragment.kt index 5ac498e8..6087ac4e 100644 --- a/app/src/main/java/com/zurichat/app/ui/organizations/NextFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/organizations/NextFragment.kt @@ -37,8 +37,8 @@ class NextFragment : Fragment(R.layout.fragment_add_to_organization) { if(prevDestLabel.equals("fragment_add_by_email")){ }else{ - generateMaterialDialog(requireActivity(),"Successful","You have successfully created" + - " $organizationName","Dismiss",null) + generateMaterialDialog(requireActivity(),getString(R.string.successful),getString(R.string.successfully_created) + + " $organizationName",getString(R.string.dismiss),null) } diff --git a/app/src/main/java/com/zurichat/app/ui/organizations/ShareLinkFragment.kt b/app/src/main/java/com/zurichat/app/ui/organizations/ShareLinkFragment.kt index 44362851..381cfa0d 100644 --- a/app/src/main/java/com/zurichat/app/ui/organizations/ShareLinkFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/organizations/ShareLinkFragment.kt @@ -59,7 +59,7 @@ class ShareLinkFragment : Fragment() { val clipboard = context?.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager val clip = ClipData.newPlainText("TextView", binding.linkGenerated.text.toString()) clipboard.setPrimaryClip(clip) - Toast.makeText(context, "link copied", Toast.LENGTH_SHORT).show() + Toast.makeText(context, getString(R.string.link_copied), Toast.LENGTH_SHORT).show() } // Set function to each item on the toolbar when they are been clicked binding.toolbarAddToSL.setNavigationOnClickListener { requireActivity().onBackPressed() } diff --git a/app/src/main/java/com/zurichat/app/ui/organizations/ui/SwitchOrganizationFragment.kt b/app/src/main/java/com/zurichat/app/ui/organizations/ui/SwitchOrganizationFragment.kt index 1275b535..3bc6fa38 100644 --- a/app/src/main/java/com/zurichat/app/ui/organizations/ui/SwitchOrganizationFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/organizations/ui/SwitchOrganizationFragment.kt @@ -104,7 +104,7 @@ class SwitchOrganizationsFragment : Fragment(R.layout.fragment_switch_organizati if (it.orgData.isNotEmpty()) { firstTime = false setUpViews(it.orgData) - binding.toolbar4.subtitle = "${it.orgData.size} Organization(s)" + binding.toolbar4.subtitle = "${it.orgData.size}" + getString(R.string.orgz) } else { firstTime = true } @@ -184,7 +184,7 @@ class SwitchOrganizationsFragment : Fragment(R.layout.fragment_switch_organizati // progressLoader.hide() if (firstTime) { progressLoader.hide() - val errorMessage = "An Error Occurred" + val errorMessage = getString(R.string.an_error_occured) snackBar(errorMessage) } } @@ -211,7 +211,7 @@ class SwitchOrganizationsFragment : Fragment(R.layout.fragment_switch_organizati adapter = userOrgAdapter } } catch (e: NullPointerException) { - Toast.makeText(context, "User has no organization", Toast.LENGTH_LONG).show() + Toast.makeText(context, getString(R.string.user_no_org), Toast.LENGTH_LONG).show() } } @@ -256,7 +256,7 @@ class SwitchOrganizationsFragment : Fragment(R.layout.fragment_switch_organizati requireActivity().finish() } is Result.Error -> { - Toast.makeText(context, "Error", Toast.LENGTH_SHORT).show() + Toast.makeText(context, getString(R.string.error), Toast.LENGTH_SHORT).show() progressLoader.hide() } is Result.Loading -> { diff --git a/app/src/main/java/com/zurichat/app/ui/settings/ChatBackupActivity.kt b/app/src/main/java/com/zurichat/app/ui/settings/ChatBackupActivity.kt index 1fc16559..534f2e89 100644 --- a/app/src/main/java/com/zurichat/app/ui/settings/ChatBackupActivity.kt +++ b/app/src/main/java/com/zurichat/app/ui/settings/ChatBackupActivity.kt @@ -5,6 +5,7 @@ import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.util.AttributeSet import android.view.View +import com.zurichat.app.R import com.zurichat.app.databinding.ActivityChatBackupBinding import com.zurichat.app.ui.settings.dialogs.BackUpGoogleDialogFragment import com.zurichat.app.ui.settings.dialogs.BackUpOverDialogFragment @@ -40,12 +41,12 @@ class ChatBackupActivity : AppCompatActivity() { binding.btnBackupOver.setOnClickListener { val backupOverDialog = BackUpOverDialogFragment(this) - backupOverDialog.show(supportFragmentManager, "Back up Dialog") + backupOverDialog.show(supportFragmentManager, getString(R.string.backup_dialog)) } binding.btnBackupGoogle.setOnClickListener { val backupGoogleDialog = BackUpGoogleDialogFragment(this) - backupGoogleDialog.show(supportFragmentManager, "Back up Google") + backupGoogleDialog.show(supportFragmentManager, getString(R.string.backup_google)) } diff --git a/app/src/main/java/com/zurichat/app/ui/settings/LargerItemsActivity.kt b/app/src/main/java/com/zurichat/app/ui/settings/LargerItemsActivity.kt index 1244fd33..bf403cc6 100644 --- a/app/src/main/java/com/zurichat/app/ui/settings/LargerItemsActivity.kt +++ b/app/src/main/java/com/zurichat/app/ui/settings/LargerItemsActivity.kt @@ -32,11 +32,11 @@ class LargerItemsActivity : AppCompatActivity() { return when (item.itemId) { R.id.action_save -> { - Toast.makeText(applicationContext, "click to save", Toast.LENGTH_SHORT).show() + Toast.makeText(applicationContext, getString(R.string.click_save), Toast.LENGTH_SHORT).show() true } R.id.action_delete -> { - Toast.makeText(applicationContext, "click to delete", Toast.LENGTH_SHORT).show() + Toast.makeText(applicationContext, getString(R.string.click_delete), Toast.LENGTH_SHORT).show() true } else -> diff --git a/app/src/main/java/com/zurichat/app/ui/settings/WallpaperActivity.kt b/app/src/main/java/com/zurichat/app/ui/settings/WallpaperActivity.kt index c842f11e..2164ed8d 100644 --- a/app/src/main/java/com/zurichat/app/ui/settings/WallpaperActivity.kt +++ b/app/src/main/java/com/zurichat/app/ui/settings/WallpaperActivity.kt @@ -73,14 +73,14 @@ class WallpaperActivity : AppCompatActivity(), // startActivity(Intent(activity, ManageWallpaperActivity::class.java)) // } - val change = findPreference("change_wallpaper") + val change = findPreference(getString(R.string.change_wallpaper)) change?.setOnPreferenceClickListener { startActivity(Intent(activity,ChooseWallpaperCategory::class.java)) true } //background dimming code - val barPref = findPreference("bar") + val barPref = findPreference(getString(R.string.bar)) barPref?.updatesContinuously = true PreferenceManager.getDefaultSharedPreferences(context).registerOnSharedPreferenceChangeListener(this) @@ -89,7 +89,7 @@ class WallpaperActivity : AppCompatActivity(), override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { val dimmer:View? = view?.findViewById(R.id.dimmer_view) - if (key == "bar"){ + if (key == getString(R.string.bar)){ val barIncr = sharedPreferences?.getInt("bar",50)?.toFloat() val flt = barIncr?.div(100.0f) if (flt != null) { diff --git a/app/src/main/java/com/zurichat/app/ui/settings/dialogs/BackUpGoogleDialogFragment.kt b/app/src/main/java/com/zurichat/app/ui/settings/dialogs/BackUpGoogleDialogFragment.kt index 0775c136..a4fa064b 100644 --- a/app/src/main/java/com/zurichat/app/ui/settings/dialogs/BackUpGoogleDialogFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/settings/dialogs/BackUpGoogleDialogFragment.kt @@ -14,7 +14,7 @@ class BackUpGoogleDialogFragment(val activity: Activity?) : DialogFragment() { return activity?.let { val builder = AlertDialog.Builder(it) - builder.setTitle("Back up to Google Drive") + builder.setTitle(getString(R.string.backup_google_drive)) .setMultiChoiceItems( R.array.back_up_google, null, diff --git a/app/src/main/java/com/zurichat/app/ui/settings/dialogs/BackUpOverDialogFragment.kt b/app/src/main/java/com/zurichat/app/ui/settings/dialogs/BackUpOverDialogFragment.kt index 3f6caa60..7b23878a 100644 --- a/app/src/main/java/com/zurichat/app/ui/settings/dialogs/BackUpOverDialogFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/settings/dialogs/BackUpOverDialogFragment.kt @@ -14,7 +14,7 @@ class BackUpOverDialogFragment(val activity: Activity?) : DialogFragment() { return activity?.let { val builder = AlertDialog.Builder(it) - builder.setTitle("Back up Over") + builder.setTitle(getString(R.string.back_up_over)) .setSingleChoiceItems( R.array.back_up_over, 0, diff --git a/app/src/main/java/com/zurichat/app/ui/settings/fragments/ChatFragment.kt b/app/src/main/java/com/zurichat/app/ui/settings/fragments/ChatFragment.kt index a02b3415..a7e1be60 100644 --- a/app/src/main/java/com/zurichat/app/ui/settings/fragments/ChatFragment.kt +++ b/app/src/main/java/com/zurichat/app/ui/settings/fragments/ChatFragment.kt @@ -45,7 +45,7 @@ class ChatFragment : PreferenceFragmentCompat() { override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { setPreferencesFromResource(R.xml.chat_preferences, rootKey) - findPreference("chat_backup")?.setOnPreferenceClickListener { + findPreference(getString(R.string.chat_backup))?.setOnPreferenceClickListener { val intent = Intent(requireActivity(), ChatBackupActivity::class.java) startActivity(intent) diff --git a/app/src/main/java/com/zurichat/app/ui/settings/fragments/ChooseWallpaperCategory.kt b/app/src/main/java/com/zurichat/app/ui/settings/fragments/ChooseWallpaperCategory.kt index 35c0cfb4..a8822057 100644 --- a/app/src/main/java/com/zurichat/app/ui/settings/fragments/ChooseWallpaperCategory.kt +++ b/app/src/main/java/com/zurichat/app/ui/settings/fragments/ChooseWallpaperCategory.kt @@ -9,7 +9,7 @@ class ChooseWallpaperCategory: AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.fragment_choose_wallpaper_category) - title = "Choose Wallpaper Category" + title = getString(R.string.choose_category) supportActionBar?.setDisplayShowHomeEnabled(true) supportActionBar?.setDisplayHomeAsUpEnabled(true) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 64566108..e4120c43 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -258,18 +258,68 @@ البرتغالية أضف مساحة العمل قم بإنشاء مساحة عمل جديدة - Error - channel_tones - message_tone - vibrate - Channel tones off - Channel tones on - Message tones off - Message tones on - Vibrate off - Vibrate on - High priority Notifications off - Should not attempt to get bindings when Fragment views are destroyed. - name - about + معرف المؤسسة الحالي + خطأ + يهتز + أولوية عالية + نغمات القناة متوقفة + نغمات القناة + إيقاف نغمات الرسائل + تشغيل نغمات الرسائل + إيقاف الاهتزاز + الاهتزاز عند + إيقاف الإشعارات ذات الأولوية العالية + الإشعارات ذات الأولوية القصوى على + يجب عدم محاولة الحصول على ارتباطات عند إتلاف عروض التجزئة. + name + about + تم منح الإذن! + تم رفض الإذن! + تسجيل + غير قادر على بدء الكاميرا! + تحرير رقم الهاتف + حفظ + تم التحديث بنجاح + تم الإرسال بنجاح + خطأ 400 ، غير صالح + خطأ 404 ، غير موجود + رسالة جديدة + إظهار الرموز التعبيرية + لم يتم التقاط الصورة + تم الانضمام إلى القناة بنجاح + إعادة المحاولة + \ "الحساب (الحسابات) \" + تطابق كلمة المرور + كلمة المرور غير متطابقة + \ "تم تغيير كلمة المرور بنجاح \ n مطلوب تسجيل دخول حديث \" + الرجاء إعادة المحاولة + الرجاء الانتظار + تم تسجيل خروجك بنجاح من الحساب السابق + تحميل + رمز خاطئ حاول مرة أخرى + الرمز الحالي + هل أنت متأكد أنك تريد إعادة تعيين كلمة المرور لهذا الحساب؟ + تأكيد + \ "حدث خطأ يرجى المحاولة مرة أخرى \" + رسالة خطأ + لا يمكن أن يكون اسم القناة فارغًا. + خارج + المحدد + خطأ في تحميل البيانات من الخادم + المستخدم ليس لديه مؤسسة + المؤسسة (المنظمات) + دعوة بالبريد الإلكتروني + يجب إضافة بريد إلكتروني واحد على الأقل + تم إرسال الدعوة بنجاح + رفض + لقد نجحت في إنشاء + تم نسخ الرابط + نسخ احتياطي إلى Google Drive + النسخ الاحتياطي عبر + اختر فئة ورق الحائط + bar + انقر للحفظ + انقر للحذف + مربع حوار النسخ الاحتياطي + نسخ Google احتياطيًا \ No newline at end of file diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index d0169caf..e1cbc831 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -260,21 +260,70 @@ Sie können die Zuletzt gesehen von anderen Personen nicht sehen E-Mail bestätigen Geben Sie die registrierte zuri-Chat-E-Mail ein TitZuri DMs: Team Tolstoy - Kotlin Java Mobile -Zuri Chat: Kanäle und DMs - Geschäftsbedingungen + Geschäftsbedingungen Keine Internetverbindung! - Error - channel_tones - message_tone - vibrate - Channel tones off - Channel tones on - Message tones off - Message tones on - Vibrate off - Vibrate on - High priority Notifications off - Should not attempt to get bindings when Fragment views are destroyed. + Aktuelle Organisations-ID + Fehler + vibrieren + high_priority + Kanaltöne aus + Kanaltöne an + Nachrichtentöne aus + Nachrichtentöne an + Vibrieren aus + Vibrieren an + Benachrichtigungen mit hoher Priorität aus + Benachrichtigungen mit hoher Priorität ein + Sollte nicht versuchen, Bindungen abzurufen, wenn Fragmentansichten zerstört werden. name - about + über + Berechtigung erteilt! + Berechtigung verweigert! + Aufnahme + Kamera kann nicht gestartet werden! + Telefonnummer bearbeiten + Speichern + Update erfolgreich + Erfolgreich gesendet + Fehler 400, ungültig + Fehler 404, nicht gefunden + Neue Nachricht + Emoji anzeigen + Bild nicht aufgenommen + Kanal erfolgreich beigetreten + Wiederholen + \" Account(s)\" + Passwortübereinstimmung + Passwort stimmt nicht überein + \"Passwortänderung erfolgreich\n Neue Anmeldung erforderlich\" + Bitte erneut versuchen + Bitte warten + Sie wurden erfolgreich vom vorherigen Konto abgemeldet + Laden + Falscher Code versuche es noch einmal + Aktueller Code + Möchten Sie das Passwort für dieses Konto wirklich zurücksetzen? + Bestätigung + \"Ein Fehler ist aufgetreten, bitte versuche es noch einmal \" + FEHLERMELDUNG + Kanalname darf nicht leer sein. + aus + ausgewählt + Fehler beim Laden von Daten vom Server + Benutzer hat keine Organisation + Organisation(en) + Per E-Mail einladen + Du musst mindestens eine E-Mail hinzufügen + Einladung erfolgreich gesendet + Verwerfen + Sie haben erfolgreich erstellt + Link kopiert + Auf Google Drive sichern + Backup über + Hintergrundkategorie auswählen + Bar + zum Speichern klicken + zum Löschen klicken + Sicherungsdialog + Google sichern diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 87fdb3cb..2211316a 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -253,21 +253,72 @@ Verificar correo electrónico Ingrese el correo electrónico de chat de zuri registrado TitZuri DMs: Equipo Tolstoy - Kotlin Java Mobile -Zuri Chat: Canales y DM Términos y condiciones ¡Sin conexión a Internet! - Error - channel_tones - message_tone - vibrate - Channel tones off - Channel tones on - Message tones off - Message tones on - Vibrate off - Vibrate on - High priority Notifications off - Should not attempt to get bindings when Fragment views are destroyed. - name - about + + + ID de organización actual + Error + vibrar + high_priority + Tonos de canal desactivados + Tonos de canal activados + Tonos de mensaje desactivados + Tonos de mensaje activados + Vibrar apagado + Vibrar + Notificaciones de alta prioridad desactivadas + Notificaciones de alta prioridad en + No debe intentar obtener enlaces cuando se destruyen las vistas de fragmentos. + nombre + acerca de + ¡Permiso concedido! + ¡Permiso denegado! + grabando + ¡No se puede iniciar la cámara! + Editar número de teléfono + Guardar + Actualización exitosa + Enviado con éxito + Error 400, no válido + Error 404, no encontrado + Nuevo mensaje + Mostrar emoji + Foto no tomada + Se unió al canal con éxito + Reintentar + \ "Cuenta (s) \" + Coincidencia de contraseña + La contraseña no coincide + \ "cambio de contraseña exitoso \ n Se requiere inicio de sesión nuevo \" + Vuelva a intentarlo + Espere + Se ha cerrado con éxito la sesión de la cuenta anterior + Cargando + Código incorrecto, inténtelo de nuevo + Código actual + ¿Está seguro de que desea restablecer la contraseña de esta cuenta? + Confirmación + \ "Se produjo un error, inténtelo de nuevo \" + MENSAJE DE ERROR + El nombre del canal no puede estar vacío. + de + seleccionado + Error al cargar datos desde el servidor + El usuario no tiene organización + Organización (es) + Invitar por correo electrónico + Debe agregar al menos un correo electrónico + Invitación enviada correctamente + Descartar + Ha creado correctamente + enlace copiado + Copia de seguridad en Google Drive + Copia de seguridad en + Elija una categoría de papel tapiz + barra + haga clic para guardar + haga clic para eliminar + Cuadro de diálogo de copia de seguridad + Copia de seguridad de Google \ No newline at end of file diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index 98d2a06f..710b497e 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -258,18 +258,68 @@ Portugais Ajouter un espace de travail Créer un nouvel espace de travail - Error - channel_tones - message_tone - vibrate - Channel tones off - Channel tones on - Message tones off - Message tones on - Vibrate off - Vibrate on - High priority Notifications off - Should not attempt to get bindings when Fragment views are destroyed. - name - about + ID d\'organisation actuel + Erreur + high_priority + Sons des canaux désactivés + Sonneries de canal activées + Sonneries de message désactivées + Sonneries de message activées + Vibreur désactivé + Vibrer sur + Notifications prioritaires désactivées + Notifications prioritaires activées + Ne devrait pas tenter d\'obtenir des liaisons lorsque les vues Fragment sont détruites. + nom + à propos + Autorisation accordée ! + Autorisation refusée ! + enregistrement + Impossible de démarrer la caméra ! + Modifier le numéro de téléphone + Enregistrer + Mise à jour réussie + Envoyé avec succès + Erreur 400, invalide + Erreur 404, introuvable + Nouveau message + Afficher les Emoji + Photo non prise + Chaîne jointe avec succès + Réessayer + \" Compte(s)\" + Correspondance du mot de passe + Le mot de passe ne correspond pas + \"changement de mot de passe réussi\n Nouvelle connexion requise\" + Veuillez réessayer + Veuillez patienter + Vous avez été déconnecté avec succès du compte précédent + Chargement + Code erroné, réessayez + Code actuel + Voulez-vous vraiment réinitialiser le mot de passe de ce compte ? + Confirmation + \"Une erreur s\'est produite, veuillez réessayer \" + MESSAGE D\'ERREUR + Le nom du canal ne peut pas être vide. + sur + sélectionné + Erreur lors du chargement des données depuis le serveur + L\'utilisateur n\'a pas d'organisation + Organisation(s) + Inviter par e-mail + Vous devez ajouter au moins un e-mail + Invitation envoyée avec succès + Rejeter + Vous avez réussi à créer + lien copié + Sauvegarder sur Google Drive + Sauvegarder par dessus + Choisir la catégorie de papier peint + bar + cliquer pour enregistrer + cliquer pour supprimer + Boîte de dialogue de sauvegarde + Sauvegarder Google + vibrer \ No newline at end of file diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 85f7c78e..508667af 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -256,4 +256,68 @@ portoghese Aggiungi spazio di lavoro Creare un nuovo spazio di lavoro + ID organizzazione corrente + Errore + high_priority + Toni canale disattivati + Toni del canale attivati + Toni messaggi disattivati + Toni dei messaggi attivati + Vibrazione disattivata + Vibra su + Notifiche ad alta priorità disattivate + Notifiche ad alta priorità attivate + Non dovrebbe tentare di ottenere collegamenti quando le viste dei frammenti vengono distrutte. + nome + about + Autorizzazione concessa! + Permesso negato! + registrazione + Impossibile avviare la fotocamera! + Modifica numero di telefono + Salva + Aggiornamento riuscito + Inviato con successo + Errore 400, non valido + Errore 404, non trovato + Nuovo messaggio + Mostra Emoji + Foto non scattata + Aderito al canale con successo + Riprova + \" Account(s)\" + Corrispondenza password + La password non corrisponde + \"cambio password riuscito\n Nuovo accesso richiesto\" + Riprova di nuovo + Attendere prego + Sei stato disconnesso con successo dall\'account precedente + Caricamento + Codice sbagliato riprova + Codice attuale + Sei sicuro di voler reimpostare la password per questo account? + Conferma + \"Si è verificato un errore riprovare \" + MESSAGGIO DI ERRORE + Il nome del canale non può essere vuoto. + fuori da + selezionato + Errore nel caricamento dei dati dal server + L\'utente non ha organizzazione + Organizzazione(i) + Invita tramite e-mail + Devi aggiungere almeno un\'email + Invito inviato con successo + Ignora + Hai creato con successo + link copiato + Backup su Google Drive + Backup su + Scegli la categoria dello sfondo + bar + fai clic per salvare + fai clic per eliminare + Finestra di backup + Esegui il backup di Google + vibrare \ No newline at end of file diff --git a/app/src/main/res/values-iw/strings.xml b/app/src/main/res/values-iw/strings.xml index f276f8d4..1aff6245 100644 --- a/app/src/main/res/values-iw/strings.xml +++ b/app/src/main/res/values-iw/strings.xml @@ -129,7 +129,7 @@ הודעת DM הודעות שלא נקראו ערוצים - + תנאים והגבלות מקוון מפתחי אנדרואיד Lux, Hamid, Joe, +234707… @@ -258,18 +258,70 @@ פורטוגזית הוסף סביבת עבודה צור סביבת עבודה חדשה - Error - channel_tones - message_tone - vibrate - Channel tones off - Channel tones on - Message tones off - Message tones on - Vibrate off - Vibrate on - High priority Notifications off - Should not attempt to get bindings when Fragment views are destroyed. - name - about + מזהה ארגון נוכחי + שגיאה + רטט + high_priority + צלילי הערוץ כבויים + צלילי הערוץ מופעלים + צלילי הודעה כבויים + צלילי הודעה מופעלים + רטט כבוי + רטט ב + הודעות בעדיפות גבוהה מושבתות + הודעות בעדיפות גבוהה ב- + לא צריך לנסות להשיג כריכות כאשר תצוגות קטעים נהרסות. + שם + אודות + הרשאה ניתנה! + הרשאה נדחתה! + הקלטה + לא ניתן להפעיל את המצלמה! + ערוך מספר טלפון + שמור + העדכון הצליח + נשלח בהצלחה + שגיאה 400, לא חוקית + שגיאה 404, לא נמצאה + הודעה חדשה + הצג אימוג\'י + תמונה לא צולמה + הצטרף לערוץ בהצלחה + נסה שוב + \" חשבונות\" + התאמת סיסמה + הסיסמה לא תואמת + \"שינוי הסיסמה הצליח\n נדרש כניסה טרי\" + אנא נסה שוב + אנא המתן + ניתקת בהצלחה מחשבון קודם + טוען + קוד שגוי נסה שוב + קוד נוכחי + האם אתה בטוח שברצונך לאפס את הסיסמה עבור חשבון זה? + אישור + \"אירעה שגיאה אנא נסה שוב \" + הודעת שגיאה + שם הערוץ לא יכול להיות ריק. + מחוץ ל + נבחר + שגיאה בטעינת נתונים מהשרת + למשתמש אין ארגון + ארגון(ים) + הזמן בדוא"ל + עליך להוסיף דוא"ל אחד לפחות + ההזמנה נשלחה בהצלחה + סגור + יצרת בהצלחה + הקישור הועתק + גבה ב-Google Drive + גיבוי מעל + בחר קטגוריית טפט + סרגל + לחץ כדי לשמור + לחץ כדי למחוק + דיאלוג גיבוי + גבה את Google + TitZuri DMs: Team Tolstoy - Kotlin Java Mobile + שיחת וידאו \ No newline at end of file diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index 46e3fc78..48b3b494 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -258,16 +258,69 @@ Português Adicionar Espaço de Trabalho Criar novo espaço de trabalho - channel_tones - message_tone - vibrate - Channel tones off - Channel tones on - Message tones off - Message tones on - Vibrate off - Vibrate on - High priority Notifications off - Should not attempt to get bindings when Fragment views are destroyed. - about + + Erro + alta_prioridade + tons do canal desativados + Tons do canal em + Tons de mensagem desativados + Tons de mensagem em + Vibrar + Vibrar + Notificações de alta prioridade desativadas + Notificações de alta prioridade em + Não deve tentar obter ligações quando as visualizações de fragmento são destruídas. + nome + sobre + Permissão concedida! + Permissão negada! + gravação + Impossível iniciar a câmera! + Editar número de telefone + Salvar + Atualização bem-sucedida + Enviado com sucesso + Erro 400, inválido + Erro 404, não encontrado + Nova mensagem + Mostrar Emoji + Foto não tirada + Entrou no canal com sucesso + Tentar novamente + \ "Conta (s) \" + Correspondência de senha + Senha não corresponde + \ "alteração de senha bem-sucedida \ n É necessário novo login \" + Tente novamente + Aguarde + Você foi desconectado com sucesso da conta anterior + Carregando + Código errado, tente novamente + Código atual + Tem certeza de que deseja redefinir a senha desta conta? + Confirmação + \ "Ocorreu um erro, tente novamente \" + MENSAGEM DE ERRO + O nome do canal não pode estar vazio. + de + selecionado + Erro ao carregar dados do servidor + O usuário não tem organização + Organização (ões) + Convidar por e-mail + Você deve adicionar pelo menos um e-mail + Convite enviado com sucesso + Dispensar + Você criou com sucesso + link copiado + Backup no Google Drive + Backup acima + Escolha a categoria do papel de parede + bar + clique para salvar + clique para excluir + Caixa de diálogo de backup + Backup do Google + vibrar + ID da organização atual \ No newline at end of file diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index b899080c..2b59b107 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -243,8 +243,7 @@ 验证邮件 输入已注册的 zuri 聊天电子邮件 TitZuri DM:托尔斯泰团队 - Kotlin Java Mobile -Zuri 聊天:频道和 DM - 条款和条件 + 条款和条件 语言 标题 选择语言翻译 @@ -260,4 +259,69 @@ 葡萄牙语 添加工作区 创建新工作区 + 当前组织 ID + 错误 + 振动 + high_priority + 频道音关闭 + 开启频道音 + 消息音关闭 + 消息提示音 + 关闭振动 + 振动开启 + 关闭高优先级通知 + 高优先级通知 + 当 Fragment 视图被销毁时不应尝试获取绑定。 + 姓名 + 关于 + 已授予权限! + 权限被拒绝! + 录音 + 无法启动相机! + 编辑电话号码 + 保存 + 更新成功 + 发送成功 + 错误 400,无效 + 错误 404,未找到 + 新消息 + 显示表情符号 + 图片未拍摄 + 加入频道成功 + 重试 + \"帐户\" + 密码匹配 + 密码不匹配 + \"密码更改成功\n 需要重新登录\" + 请重试 + 请稍候 + 您已成功退出之前的帐户 + 正在加载 + 错误代码重试 + 当前代码 + 您确定要重置此帐户的密码吗? + 确认 + \"发生错误,请重试\" + 错误信息 + 频道名称不能为空。 + 超出 + 选中 + 从服务器加载数据时出错 + 用户没有组织 + 组织 + 通过电子邮件邀请 + 您必须至少添加一封电子邮件 + 邀请发送成功 + 关闭 + 您已成功创建 + 复制的链接 + 备份到 Google Drive + 备份结束 + 选择壁纸类别 + bar + 点击保存 + 点击删除 + 备份对话框 + 备份谷歌 + 没有网络连接 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index c412cd6d..5bd826ef 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -157,7 +157,6 @@ Unread messages Channels - terms and conditions online Android Devs Lux, Hamid, Joe, +234707… @@ -301,17 +300,17 @@ Portuguese Add Workspace Create New Workspace - chat_header - security_header - storage_header - notification_header - logout_header - USER - LOG_OUT + chat_header + security_header + storage_header + notification_header + logout_header + USER + LOG_OUT Current Organization ID Error - channel_tones - message_tone + channel_tones + message_tone vibrate high_priority Channel tones off @@ -325,4 +324,54 @@ Should not attempt to get bindings when Fragment views are destroyed. name about + Permission Granted! + Permission Denied! + recording + Unable to Start Camera! + Edit Phone Number + Save + Update Successful + Sent Successfully + Error 400, invalid + Error 404, Not found + New message + Show Emoji + Picture not taken + Joined Channel Successfully + Retry + \" Account(s)\" + Password match + Password doesn\'t match + \"password change successful\n Fresh sign in required\" + Please retry again + Please wait + You have been successfully logged out of previous account + Loading + Wrong code try again + Current code + Are you sure you want to reset the password for this account? + Confirmation + \"An Error occurred please try again \" + ERROR MESSAGE + Channel name can\'t be empty. + out of + selected + Error in Loading data from server + User has no organization + Organization(s) + Invite By Email + You must at least add one email + Invitation sent successfully + Dismiss + You have successfully created + link copied + Back up to Google Drive + Back up Over + Choose Wallpaper Category + bar + click to save + click to delete + Back up Dialog + Back up Google + terms and conditions From 0bc05bfb9b3dd55a6eb65036a3509b2db9f97254 Mon Sep 17 00:00:00 2001 From: EricoMartin Date: Fri, 29 Oct 2021 20:28:10 +0100 Subject: [PATCH 3/5] localize string resources --- app/src/main/res/values-ar/strings.xml | 114 ++++++++++++------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index e4120c43..33470e8f 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -258,68 +258,68 @@ البرتغالية أضف مساحة العمل قم بإنشاء مساحة عمل جديدة - معرف المؤسسة الحالي + معرف المؤسسة الحالي خطأ - يهتز - أولوية عالية - نغمات القناة متوقفة - نغمات القناة - إيقاف نغمات الرسائل - تشغيل نغمات الرسائل - إيقاف الاهتزاز - الاهتزاز عند - إيقاف الإشعارات ذات الأولوية العالية - الإشعارات ذات الأولوية القصوى على - يجب عدم محاولة الحصول على ارتباطات عند إتلاف عروض التجزئة. + يهتز + أولوية عالية + نغمات القناة متوقفة + نغمات القناة + إيقاف نغمات الرسائل + تشغيل نغمات الرسائل + إيقاف الاهتزاز + الاهتزاز عند + إيقاف الإشعارات ذات الأولوية العالية + الإشعارات ذات الأولوية القصوى على + يجب عدم محاولة الحصول على ارتباطات عند إتلاف عروض التجزئة. name about - تم منح الإذن! - تم رفض الإذن! - تسجيل - غير قادر على بدء الكاميرا! - تحرير رقم الهاتف - حفظ - تم التحديث بنجاح - تم الإرسال بنجاح - خطأ 400 ، غير صالح - خطأ 404 ، غير موجود - رسالة جديدة - إظهار الرموز التعبيرية - لم يتم التقاط الصورة - تم الانضمام إلى القناة بنجاح - إعادة المحاولة - \ "الحساب (الحسابات) \" - تطابق كلمة المرور - كلمة المرور غير متطابقة - \ "تم تغيير كلمة المرور بنجاح \ n مطلوب تسجيل دخول حديث \" - الرجاء إعادة المحاولة - الرجاء الانتظار - تم تسجيل خروجك بنجاح من الحساب السابق + تم منح الإذن! + تم رفض الإذن! + تسجيل + غير قادر على بدء الكاميرا! + تحرير رقم الهاتف + حفظ + تم التحديث بنجاح + تم الإرسال بنجاح + خطأ 400 ، غير صالح + خطأ 404 ، غير موجود + رسالة جديدة + إظهار الرموز التعبيرية + لم يتم التقاط الصورة + تم الانضمام إلى القناة بنجاح + إعادة المحاولة + \ "الحساب (الحسابات) \" + تطابق كلمة المرور + كلمة المرور غير متطابقة + \ "تم تغيير كلمة المرور بنجاح \ n مطلوب تسجيل دخول حديث \" + الرجاء إعادة المحاولة + الرجاء الانتظار + تم تسجيل خروجك بنجاح من الحساب السابق تحميل - رمز خاطئ حاول مرة أخرى - الرمز الحالي - هل أنت متأكد أنك تريد إعادة تعيين كلمة المرور لهذا الحساب؟ - تأكيد - \ "حدث خطأ يرجى المحاولة مرة أخرى \" - رسالة خطأ - لا يمكن أن يكون اسم القناة فارغًا. - خارج + رمز خاطئ حاول مرة أخرى + الرمز الحالي + هل أنت متأكد أنك تريد إعادة تعيين كلمة المرور لهذا الحساب؟ + تأكيد + \ "حدث خطأ يرجى المحاولة مرة أخرى \" + رسالة خطأ + لا يمكن أن يكون اسم القناة فارغًا. + خارج المحدد - خطأ في تحميل البيانات من الخادم - المستخدم ليس لديه مؤسسة - المؤسسة (المنظمات) - دعوة بالبريد الإلكتروني - يجب إضافة بريد إلكتروني واحد على الأقل - تم إرسال الدعوة بنجاح - رفض - لقد نجحت في إنشاء - تم نسخ الرابط + خطأ في تحميل البيانات من الخادم + المستخدم ليس لديه مؤسسة + المؤسسة (المنظمات) + دعوة بالبريد الإلكتروني + يجب إضافة بريد إلكتروني واحد على الأقل + تم إرسال الدعوة بنجاح + رفض + لقد نجحت في إنشاء + تم نسخ الرابط نسخ احتياطي إلى Google Drive - النسخ الاحتياطي عبر - اختر فئة ورق الحائط + النسخ الاحتياطي عبر + اختر فئة ورق الحائط bar - انقر للحفظ - انقر للحذف - مربع حوار النسخ الاحتياطي - نسخ Google احتياطيًا + انقر للحفظ + انقر للحذف + مربع حوار النسخ الاحتياطي + نسخ Google احتياطيًا \ No newline at end of file From fe46cccee82a6e115127017db7316843cdb3235b Mon Sep 17 00:00:00 2001 From: EricoMartin Date: Sat, 30 Oct 2021 09:45:56 +0100 Subject: [PATCH 4/5] localize string resources --- .../zurichat/app/ui/login/LoginViewModel.kt | 23 +- app/src/main/res/menu/home_menu.xml | 2 +- app/src/main/res/values-ar/strings.xml | 6 + app/src/main/res/values-de/strings.xml | 520 +++++++++--------- app/src/main/res/values-es/strings.xml | 6 + app/src/main/res/values-fr/strings.xml | 8 +- app/src/main/res/values-it/strings.xml | 6 + app/src/main/res/values-iw/strings.xml | 6 + app/src/main/res/values-pt/strings.xml | 6 + app/src/main/res/values-zh/strings.xml | 6 + app/src/main/res/values/strings.xml | 6 + app/src/main/res/xml/settings_preferences.xml | 10 +- 12 files changed, 328 insertions(+), 277 deletions(-) diff --git a/app/src/main/java/com/zurichat/app/ui/login/LoginViewModel.kt b/app/src/main/java/com/zurichat/app/ui/login/LoginViewModel.kt index bcccf674..73e7bb92 100644 --- a/app/src/main/java/com/zurichat/app/ui/login/LoginViewModel.kt +++ b/app/src/main/java/com/zurichat/app/ui/login/LoginViewModel.kt @@ -1,8 +1,9 @@ package com.zurichat.app.ui.login -import android.app.Application -import androidx.lifecycle.* -import com.zurichat.app.R +import androidx.lifecycle.LiveData +import androidx.lifecycle.MutableLiveData +import androidx.lifecycle.ViewModel +import androidx.lifecycle.viewModelScope import com.zurichat.app.data.repository.UserRepository import com.zurichat.app.models.* import com.zurichat.app.ui.login.password.confirm.ConfirmPasswordData @@ -11,13 +12,13 @@ import com.zurichat.app.ui.login.password.resetuserpass.ResetUserPasswordRespons import com.zurichat.app.util.Result import dagger.hilt.android.lifecycle.HiltViewModel import kotlinx.coroutines.CoroutineExceptionHandler +import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import timber.log.Timber import javax.inject.Inject -import kotlinx.coroutines.Dispatchers @HiltViewModel -class LoginViewModel @Inject constructor(private val repository: UserRepository) : AndroidViewModel(Application()) { +class LoginViewModel @Inject constructor(private val repository: UserRepository) : ViewModel() { private val _loginResponse = MutableLiveData>() @@ -74,8 +75,7 @@ class LoginViewModel @Inject constructor(private val repository: UserRepository) _logoutResponse.postValue(Result.Success(it)) } }else { - _logoutResponse.postValue(Result.Error(Exception(getApplication().resources.getString( - R.string.err_occured_try_again)))) + _logoutResponse.postValue(Result.Error(Exception("Error occurred please try again "))) } } } @@ -92,8 +92,7 @@ class LoginViewModel @Inject constructor(private val repository: UserRepository) } } else { - _resetCodeResponse.postValue(Result.Error(Exception(getApplication().resources.getString( - R.string.err_occured_try_again)))) + _resetCodeResponse.postValue(Result.Error(Exception("Error occurred please try again "))) } } @@ -112,8 +111,7 @@ class LoginViewModel @Inject constructor(private val repository: UserRepository) } else { _updatePassResponse.postValue(Result - .Error(Exception(getApplication().resources.getString( - R.string.err_occured_try_again)))) + .Error(Exception("Error occurred please try again "))) } } @@ -130,8 +128,7 @@ class LoginViewModel @Inject constructor(private val repository: UserRepository) _passwordReset.postValue(Result.Success(it)) } }else{ - _passwordReset.postValue(Result.Error(Exception(getApplication().resources.getString( - R.string.err_msg)))) + _passwordReset.postValue(Result.Error(Exception("ERROR MESSAGE"))) } } diff --git a/app/src/main/res/menu/home_menu.xml b/app/src/main/res/menu/home_menu.xml index 677b3057..6e9283fc 100644 --- a/app/src/main/res/menu/home_menu.xml +++ b/app/src/main/res/menu/home_menu.xml @@ -19,7 +19,7 @@ android:visible="true" />-->