Skip to content

Commit 0ef7743

Browse files
committed
update: 다국어 지원
1 parent 753cf44 commit 0ef7743

File tree

4 files changed

+185
-42
lines changed

4 files changed

+185
-42
lines changed

app/src/main/java/com/easyhz/picly/view/album/AlbumFragment.kt

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import kotlinx.coroutines.launch
3535

3636
@AndroidEntryPoint
3737
class AlbumFragment: Fragment() {
38-
private lateinit var binding : FragmentAlbumBinding
38+
private var binding : FragmentAlbumBinding? = null
3939
private lateinit var albumAdapter: AlbumAdapter
4040
private lateinit var viewModel: AlbumViewModel
4141
private lateinit var sharedViewModel: SharedAlbumStateViewModel
@@ -52,7 +52,7 @@ class AlbumFragment: Fragment() {
5252
clipboardManager = requireActivity().getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager
5353
loading = LoadingDialog(requireActivity())
5454

55-
return binding.root
55+
return binding!!.root
5656
}
5757

5858
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
@@ -62,8 +62,8 @@ class AlbumFragment: Fragment() {
6262

6363
override fun onDestroy() {
6464
super.onDestroy()
65-
if (binding.noResultMessage.visibility == View.VISIBLE) {
66-
binding.noResultMessage.visibility = View.GONE
65+
if (binding?.noResultMessage?.visibility == View.VISIBLE) {
66+
binding?.noResultMessage?.visibility = View.GONE
6767
}
6868
}
6969

@@ -83,7 +83,7 @@ class AlbumFragment: Fragment() {
8383

8484
private fun setRecyclerView() {
8585
albumAdapter = AlbumAdapter()
86-
binding.albumRecyclerView.apply {
86+
binding!!.albumRecyclerView.apply {
8787
adapter = albumAdapter
8888
layoutManager = GridLayoutManager(activity, 2)
8989
setItemViewCacheSize((2 * PAGE_SIZE).toInt())
@@ -110,11 +110,11 @@ class AlbumFragment: Fragment() {
110110
private fun setAlbums() {
111111
lifecycle.coroutineScope.launch {
112112
viewModel.refresh()
113-
if (!binding.swipeRefresh.isRefreshing) return@launch
113+
if (binding?.swipeRefresh?.isRefreshing == false) return@launch
114114
delay(500)
115115
viewModel.setSwipe(false)
116-
binding.swipeRefresh.isRefreshing = false
117-
binding.albumRecyclerView.smoothScrollToPosition(0)
116+
binding?.swipeRefresh?.isRefreshing = false
117+
binding?.albumRecyclerView?.smoothScrollToPosition(0)
118118
}
119119
}
120120

@@ -124,14 +124,14 @@ class AlbumFragment: Fragment() {
124124
if (it.prepend.endOfPaginationReached) {
125125
updateNoResultMessage()
126126
hideSkeleton()
127-
if (!viewModel.searchText.value.isNullOrEmpty()) { binding.albumRecyclerView.smoothScrollToPosition(0) }
127+
if (!viewModel.searchText.value.isNullOrEmpty()) { binding?.albumRecyclerView?.smoothScrollToPosition(0) }
128128
}
129129
}
130130
}
131131
}
132132

133133
private fun onclickFab() {
134-
binding.addFab.setOnClickListener {
134+
binding?.addFab?.setOnClickListener {
135135
NavControllerManager.navigateMainToUpload()
136136
}
137137
}
@@ -155,7 +155,7 @@ class AlbumFragment: Fragment() {
155155
private fun onClickLinkButton(albumItem: AlbumItem) {
156156
val clipData = ClipData.newPlainText(PICLY, albumItem.documentId.toPICLY())
157157
clipboardManager.setPrimaryClip(clipData)
158-
BlueSnackBar.make(binding.root, getString(R.string.link_copy)).show()
158+
binding?.root?.let { BlueSnackBar.make(it, getString(R.string.link_copy)).show() }
159159
}
160160

161161
private fun onLongClickItem(albumItem: AlbumItem, view: View) {
@@ -186,22 +186,22 @@ class AlbumFragment: Fragment() {
186186
getString(R.string.no_search_text)
187187
}
188188

189-
binding.noResultMessage.apply {
189+
binding?.noResultMessage?.apply {
190190
text = message
191191
visibility = if (albumAdapter.itemCount == 0) View.VISIBLE else View.GONE
192192
}
193193
}
194194

195195
private fun setRefresh() {
196-
binding.swipeRefresh.apply {
196+
binding?.swipeRefresh?.apply {
197197
setProgressBackgroundColorSchemeColor(ContextCompat.getColor(requireContext(), R.color.collectionViewCellBackground))
198198
setColorSchemeColors(ContextCompat.getColor(requireContext(), R.color.highlightBlue))
199199
}
200200

201201
}
202202

203203
private fun refresh() {
204-
binding.swipeRefresh.setOnRefreshListener {
204+
binding?.swipeRefresh?.setOnRefreshListener {
205205
setAlbums()
206206
viewModel.setSwipe(true)
207207
}
@@ -222,7 +222,7 @@ class AlbumFragment: Fragment() {
222222
}
223223

224224
private fun onFailure(message: String) {
225-
BlueSnackBar.make(binding.root, message).show()
225+
binding?.root?.let { BlueSnackBar.make(it, message).show() }
226226
}
227227

228228
private fun observeIsUpload() {
@@ -232,7 +232,7 @@ class AlbumFragment: Fragment() {
232232
viewModel.refresh()
233233
sharedViewModel.setIsUpload(false)
234234
delay(500)
235-
binding.albumRecyclerView.smoothScrollToPosition(0)
235+
binding?.albumRecyclerView?.smoothScrollToPosition(0)
236236
}
237237
}
238238
}
@@ -241,7 +241,7 @@ class AlbumFragment: Fragment() {
241241
private fun observeIsReselectedAlbumMenu() {
242242
viewModel.isReselectedAlbumMenu.observe(viewLifecycleOwner) { isReselected ->
243243
if (!isReselected) return@observe
244-
binding.albumRecyclerView.apply {
244+
binding?.albumRecyclerView?.apply {
245245
if (computeVerticalScrollOffset() != 0) {
246246
smoothScrollToPosition(0)
247247
}
@@ -251,21 +251,21 @@ class AlbumFragment: Fragment() {
251251
}
252252

253253
private fun hideSkeleton() {
254-
if (albumAdapter.itemCount != 0 || binding.noResultMessage.visibility == View.VISIBLE) {
255-
binding.skeletonLoading.hideShimmer()
256-
binding.skeletonLoading.stopShimmer()
257-
binding.skeletonLoading.fadeOut()
254+
if (albumAdapter.itemCount != 0 || binding?.noResultMessage?.visibility == View.VISIBLE) {
255+
binding?.skeletonLoading?.hideShimmer()
256+
binding?.skeletonLoading?.stopShimmer()
257+
binding?.skeletonLoading?.fadeOut()
258258
}
259259
}
260260

261261
private fun initSkeleton() {
262262
if (viewModel.isFirst.value == true) {
263263
viewModel.refresh()
264-
binding.skeletonLoading.startShimmer()
264+
binding?.skeletonLoading?.startShimmer()
265265
} else {
266-
binding.skeletonLoading.hideShimmer()
267-
binding.skeletonLoading.stopShimmer()
268-
binding.skeletonLoading.visibility = View.GONE
266+
binding?.skeletonLoading?.hideShimmer()
267+
binding?.skeletonLoading?.stopShimmer()
268+
binding?.skeletonLoading?.visibility = View.GONE
269269
}
270270
}
271271
}

app/src/main/java/com/easyhz/picly/view/settings/account/AccountBindingConversion.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ package com.easyhz.picly.view.settings.account
22

33
import android.widget.TextView
44
import androidx.databinding.BindingAdapter
5+
import com.easyhz.picly.R
56
import com.easyhz.picly.util.toDateFormat
67
import com.google.firebase.Timestamp
78

89
object AccountBindingConversion {
9-
private const val AUTH_PROVIDER = "로 로그인"
1010

1111
@JvmStatic
1212
@BindingAdapter("loginInfo")
1313
fun setLoginInfo(view: TextView, authProvider: String?) {
1414
if (authProvider != null) {
15-
view.text = authProvider.plus(AUTH_PROVIDER)
15+
view.text = String.format(view.context.getString(R.string.auth_provider), authProvider)
1616
}
1717
}
1818

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="bottom_album">Albums</string>
4+
<string name="bottom_setting">Settings</string>
5+
<string name="app_settings_title">Settings</string>
6+
<string name="login_title">Login</string>
7+
<string name="login_info_text">Log in and share my picture. \nMy information is not saved in the shared picture.</string>
8+
9+
<string name="error_invalid_custom_token">The custom token format is invalid. Please check the document.</string>
10+
<string name="error_custom_token_mismatch">Custom tokens do not match other destinations.</string>
11+
<string name="error_invalid_credential">Email or password does not match.</string>
12+
<string name="error_invalid_email">Email address is not formatted correctly.</string>
13+
<string name="error_wrong_password">The password is invalid.</string>
14+
<string name="error_user_mismatch">The credentials provided do not match the previously logged-in user.</string>
15+
<string name="error_requires_recent_login">Please log in again.</string>
16+
<string name="error_account_exists_with_different_credential">This email address is already in use by another account.</string>
17+
<string name="error_email_already_in_use">This email address is already in use by another account.</string>
18+
<string name="error_credential_already_in_use">An error has occurred.</string>
19+
<string name="error_user_disabled">The user account has been disabled by the administrator.</string>
20+
<string name="error_user_token_expired">Please log in again.</string>
21+
<string name="error_user_not_found">No corresponding user record exists.</string>
22+
<string name="error_invalid_user_token">Please log in again.</string>
23+
<string name="error_operation_not_allowed">This operation is not allowed.</string>
24+
<string name="error_weak_password">password must be at least 6 characters long.</string>
25+
<string name="error_missing_email">You must provide an email address.</string>
26+
<string name="error_email_empty">Please enter an email.</string>
27+
<string name="error_password_empty">Enter the password.</string>
28+
<string name="error_unknown">An unknown error occurred.</string>
29+
30+
<string name="google_login">Log in with Google</string>
31+
<string name="apple_login">Log in with Apple</string>
32+
<string name="email_login">Log in with email</string>
33+
<string name="login_email_text"><u>Log in with email</u></string>
34+
<string name="login_warning">Clicking on "Google/Apple/Email login" above means you have read and understood the Terms of Service and Privacy Policy, and agree to them.</string>
35+
<string name="terms_of_service">Terms of Service</string>
36+
<string name="privacy_policy">Privacy Policy</string>
37+
<string name="sign_up">Sign Up</string>
38+
<string name="email_text">Email</string>
39+
<string name="email_hint">Enter an email</string>
40+
<string name="password_text">Password</string>
41+
<string name="password_hint">Enter the password</string>
42+
43+
<string name="upload_album_title">Uploading the album</string>
44+
<string name="success">Success</string>
45+
<string name="tag">Tag</string>
46+
<string name="tag_hint">Enter the Tag</string>
47+
<string name="image">Picture</string>
48+
<string name="gallery_cancel">Cancel</string>
49+
<string name="gallery_add">Add</string>
50+
<string name="no_items">Gallery has no pictures.</string>
51+
<string name="over_selected">You can select up to 10 photos.</string>
52+
<string name="image_pick_state">Choose a picture</string>
53+
<string name="delete">Delete</string>
54+
<string name="expireDate">Expired Date</string>
55+
<string name="upload_warning">
56+
Please respect other users\' creations or intellectual property rights. \nUnauthorized use of other people\'s works is prohibited. \nDo not upload sensational or offensive images or profanity. \nPlease be careful not to expose other people\'s personal information.
57+
</string>
58+
<string name="album">Album</string>
59+
<string name="gallery_album_title">Album Name</string>
60+
<string name="gallery_alert_title">Move?</string>
61+
<string name="gallery_alert_message">Changes will not be saved.</string>
62+
<string name="gallery_alert_continue">Continue</string>
63+
<string name="gallery_alert_cancel">Go Back</string>
64+
<string name="detail_info_title">Detail Information</string>
65+
<string name="viewCount">View Count</string>
66+
67+
<string name="no_select_image">No selected images</string>
68+
<string name="link_copy">Link copied</string>
69+
<string name="cancel">Cancel</string>
70+
<string name="share">Share</string>
71+
<string name="menu">Menu</string>
72+
<string name="dialog_delete_title">Delete Album</string>
73+
<string name="dialog_delete_message">Are you sure you want to delete?</string>
74+
75+
<string name="dialog_gallery_permission_title">Permission Setting</string>
76+
<string name="dialog_gallery_permission_message">Please set permissions in the app settings for file and media access.</string>
77+
<string name="dialog_gallery_permission_positive">App Settings</string>
78+
<string name="dialog_gallery_permission_negative">Close</string>
79+
80+
<string name="dialog_upload_title">Upload Complete</string>
81+
<string name="dialog_upload_message">Do you want to copy the link?</string>
82+
<string name="dialog_upload_positive">Copy Link and Close</string>
83+
<string name="dialog_upload_negative">Close</string>
84+
85+
<string name="setting_account">Account Management</string>
86+
<string name="setting_tutorial">View Tutorial</string>
87+
<string name="setting_terms_of_service">Terms of Service</string>
88+
<string name="setting_privacy_policy">Privacy Policy</string>
89+
<string name="setting_opensource_license">Open Source Licenses</string>
90+
<string name="setting_developer">Developer Information</string>
91+
<string name="setting_version">Version</string>
92+
93+
<string name="onboarding_skip"><u>Skip</u></string>
94+
<string name="onboarding">Onboarding</string>
95+
<string name="onboarding_title_share">Easy Anonymous Picture Sharing</string>
96+
<string name="onboarding_message_share">
97+
PICLY offers a fast and secure way to share photos.
98+
\nUpload photos anonymously and easily share them via links.
99+
</string>
100+
<string name="onboarding_title_anonymity">Guaranteed Anonymity</string>
101+
<string name="onboarding_message_anonymity">
102+
Users accessing the album via the shared link
103+
\nwill not be able to see the creator\'s information.
104+
\nIf you want to pass on photos without revealing yourself,
105+
\nPICLY is the best choice.
106+
</string>
107+
<string name="onboarding_title_expired_album">Automatically Expiring Albums</string>
108+
<string name="onboarding_expired_album">
109+
When publishing an album, set an expiration time.
110+
\nAfter the expiration time, the link will automatically expire,
111+
\nand only you can access the album.
112+
\nNow, manage your albums even more conveniently.
113+
</string>
114+
<string name="onboarding_button_next">Next</string>
115+
<string name="onboarding_button_start">Start</string>
116+
117+
<string name="account_title">Account Management</string>
118+
<string name="account_logout">Log out</string>
119+
<string name="account_delete">Delete Account</string>
120+
<string name="account_email">Email</string>
121+
<string name="account_creation_time">Creation Date</string>
122+
<string name="account_login_info">Login Information</string>
123+
<string name="dialog_logout_title">Log out</string>
124+
<string name="dialog_logout_message">Are you sure you want to log out?</string>
125+
<string name="dialog_delete_user_title">Re-authentication</string>
126+
<string name="dialog_delete_user_message">Re-authentication is required to delete your account.\nDo you want to re-authenticate?</string>
127+
<string name="recertification">Re-authentication</string>
128+
<string name="search_tag">Search Tags</string>
129+
<string name="no_search_text">No search results.</string>
130+
<string name="ready">Preparing…</string>
131+
<string name="no_data_text">
132+
No albums uploaded.\n
133+
Press the + button to upload and share albums.
134+
</string>
135+
<string name="incoming_image_error">Failed to load image.</string>
136+
<string name="check_permission_message">Please set permissions in the app settings.</string>
137+
<string name="save">Save</string>
138+
<string name="save_to_image_success">Image saved successfully.</string>
139+
<string name="save_to_image_failure">Failed to save image.</string>
140+
141+
<string name="auth_provider">Log in with %s</string>
142+
</resources>

0 commit comments

Comments
 (0)