1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-23 02:16:48 +01:00

Make strings translatable

This commit is contained in:
Arjan Schrijver 2024-09-07 21:37:28 +02:00
parent 40c89c7512
commit 8b1a061e4c
4 changed files with 95 additions and 48 deletions

View File

@ -152,11 +152,11 @@
</activity> </activity>
<activity <activity
android:name=".activities.welcome.WelcomeActivity" android:name=".activities.welcome.WelcomeActivity"
android:label="Welcome" android:label="@string/first_start_welcome_title"
android:parentActivityName=".activities.ControlCenterv2" /> android:parentActivityName=".activities.ControlCenterv2" />
<activity <activity
android:name=".activities.PermissionsActivity" android:name=".activities.PermissionsActivity"
android:label="Permissions" android:label="@string/first_start_permissions_title"
android:parentActivityName=".activities.ControlCenterv2" /> android:parentActivityName=".activities.ControlCenterv2" />
<activity <activity
android:name=".activities.SettingsActivity" android:name=".activities.SettingsActivity"

View File

@ -67,58 +67,58 @@ public class PermissionsUtils {
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
CUSTOM_PERM_NOTIFICATION_LISTENER, CUSTOM_PERM_NOTIFICATION_LISTENER,
activity.getString(R.string.menuitem_notifications), activity.getString(R.string.menuitem_notifications),
"Forwarding notifications to connected gadgets")); activity.getString(R.string.permission_notifications_summary)));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
CUSTOM_PERM_NOTIFICATION_SERVICE, CUSTOM_PERM_NOTIFICATION_SERVICE,
"Manage Do Not Disturb", activity.getString(R.string.permission_manage_dnd_title),
"Changing DND notification policy")); activity.getString(R.string.permission_manage_dnd_summary)));
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
CUSTOM_PERM_DISPLAY_OVER, CUSTOM_PERM_DISPLAY_OVER,
"Display over other apps", activity.getString(R.string.permission_displayover_title),
"Used by Bangle.js for starting apps and other functionality on your phone")); activity.getString(R.string.permission_displayover_summary)));
} }
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_FINE_LOCATION,
"Fine location", activity.getString(R.string.permission_fine_location_title),
"Scanning for Bluetooth devices")); activity.getString(R.string.permission_fine_location_summary)));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.ACCESS_BACKGROUND_LOCATION, Manifest.permission.ACCESS_BACKGROUND_LOCATION,
"Background location", activity.getString(R.string.permission_background_location_title),
"Scanning for Bluetooth devices in the background and sending the location to certain gadgets")); activity.getString(R.string.permission_background_location_summary)));
} }
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R) {
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.BLUETOOTH, Manifest.permission.BLUETOOTH,
"Bluetooth", activity.getString(R.string.permission_bluetooth_title),
"Connecting to Bluetooth devices")); activity.getString(R.string.permission_bluetooth_summary)));
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.BLUETOOTH_ADMIN, Manifest.permission.BLUETOOTH_ADMIN,
"Bluetooth admin", activity.getString(R.string.permission_bluetooth_admin_title),
"Discovering and pairing Bluetooth devices")); activity.getString(R.string.permission_bluetooth_admin_summary)));
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.BLUETOOTH_SCAN, Manifest.permission.BLUETOOTH_SCAN,
"Bluetooth scan", activity.getString(R.string.permission_bluetooth_scan_title),
"Scanning for new Bluetooth devices")); activity.getString(R.string.permission_bluetooth_scan_summary)));
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.BLUETOOTH_CONNECT, Manifest.permission.BLUETOOTH_CONNECT,
"Bluetooth connect", activity.getString(R.string.permission_bluetooth_connect_title),
"Connecting to already-paired Bluetooth devices")); activity.getString(R.string.permission_bluetooth_connect_summary)));
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.POST_NOTIFICATIONS, Manifest.permission.POST_NOTIFICATIONS,
"Post notifications", activity.getString(R.string.permission_post_notification_title),
"Posting ongoing notification which keeps the service running")); activity.getString(R.string.permission_post_notification_summary)));
} }
if (BuildConfig.INTERNET_ACCESS) { if (BuildConfig.INTERNET_ACCESS) {
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.INTERNET, Manifest.permission.INTERNET,
"Internet access", activity.getString(R.string.permission_internet_access_title),
"Synchronization with online resources")); activity.getString(R.string.permission_internet_access_summary)));
} }
// permissionsList.add(new PermissionDetails( // NOTE: can't request this, it's only allowed for system apps // permissionsList.add(new PermissionDetails( // NOTE: can't request this, it's only allowed for system apps
// Manifest.permission.MEDIA_CONTENT_CONTROL, // Manifest.permission.MEDIA_CONTENT_CONTROL,
@ -126,53 +126,53 @@ public class PermissionsUtils {
// "Read and control media playback")); // "Read and control media playback"));
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.READ_CONTACTS, Manifest.permission.READ_CONTACTS,
"Contacts", activity.getString(R.string.permission_contacts_title),
"Sending contacts to gadgets")); activity.getString(R.string.permission_contacts_summary)));
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.READ_CALENDAR, Manifest.permission.READ_CALENDAR,
"Calendar", activity.getString(R.string.permission_calendar_title),
"Sending calendar to gadgets")); activity.getString(R.string.permission_calendar_summary)));
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.RECEIVE_SMS, Manifest.permission.RECEIVE_SMS,
"Receive SMS", activity.getString(R.string.permission_receive_sms_title),
"Forwarding SMS messages to gadgets")); activity.getString(R.string.permission_receive_sms_summary)));
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.SEND_SMS, Manifest.permission.SEND_SMS,
"Send SMS", activity.getString(R.string.permission_send_sms_title),
"Sending SMS (canned response) from gadgets")); activity.getString(R.string.permission_send_sms_summary)));
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.READ_CALL_LOG, Manifest.permission.READ_CALL_LOG,
"Read call log", activity.getString(R.string.permission_read_call_log_title),
"Forwarding call log to gadgets")); activity.getString(R.string.permission_read_call_log_summary)));
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.READ_PHONE_STATE, Manifest.permission.READ_PHONE_STATE,
"Read phone state", activity.getString(R.string.permission_read_phone_state_title),
"Reading status of ongoing calls")); activity.getString(R.string.permission_read_phone_state_summary)));
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.CALL_PHONE, Manifest.permission.CALL_PHONE,
"Call phone", activity.getString(R.string.permission_call_phone_title),
"Initiating phone calls from gadgets")); activity.getString(R.string.permission_call_phone_summary)));
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.PROCESS_OUTGOING_CALLS, Manifest.permission.PROCESS_OUTGOING_CALLS,
"Process outgoing calls", activity.getString(R.string.permission_process_outgoing_calls_title),
"Reading the number of an outgoing call to display it on a gadget")); activity.getString(R.string.permission_process_outgoing_calls_summary)));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.ANSWER_PHONE_CALLS, Manifest.permission.ANSWER_PHONE_CALLS,
"Answer phone calls", activity.getString(R.string.permission_answer_phone_calls_title),
"Answering phone calls from gadgets")); activity.getString(R.string.permission_answer_phone_calls_summary)));
} }
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) { if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.S_V2) {
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE,
"External storage", activity.getString(R.string.permission_external_storage_title),
"Using images, ringtones, app files and more")); activity.getString(R.string.permission_external_storage_summary)));
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
permissionsList.add(new PermissionDetails( permissionsList.add(new PermissionDetails(
Manifest.permission.QUERY_ALL_PACKAGES, Manifest.permission.QUERY_ALL_PACKAGES,
"Query all packages", activity.getString(R.string.permission_query_all_packages_title),
"Reading names and icons of all installed apps")); activity.getString(R.string.permission_query_all_packages_summary)));
} }
return permissionsList; return permissionsList;
} }

View File

@ -20,12 +20,12 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textStyle="bold" android:textStyle="bold"
android:text="Permission name" /> android:text="Placeholder: Permission name" />
<TextView <TextView
android:id="@+id/permission_summary" android:id="@+id/permission_summary"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="Permission summary" /> android:text="Placeholder: Permission summary" />
</LinearLayout> </LinearLayout>
<Button <Button
android:id="@+id/permission_request" android:id="@+id/permission_request"
@ -33,7 +33,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
android:text="Request" /> android:text="@string/first_start_permissions_request_button" />
<ImageView <ImageView
android:id="@+id/permission_check" android:id="@+id/permission_check"
android:layout_width="wrap_content" android:layout_width="wrap_content"

View File

@ -3413,6 +3413,9 @@
<string name="music_rename_playlist">Rename playlist</string> <string name="music_rename_playlist">Rename playlist</string>
<string name="music_error">Error occurred</string> <string name="music_error">Error occurred</string>
<string name="music_huawei_device_info">Supported formats: %1$s\nWatch storage: %2$d MB</string> <string name="music_huawei_device_info">Supported formats: %1$s\nWatch storage: %2$d MB</string>
<!-- Welcome screens strings -->
<string name="first_start_welcome_title">Welcome</string>
<string name="first_start_intro_welcome_to">Welcome to</string> <string name="first_start_intro_welcome_to">Welcome to</string>
<string name="first_start_intro_tag_line">Break free from the proprietary apps and cloud services of gadget vendors.</string> <string name="first_start_intro_tag_line">Break free from the proprietary apps and cloud services of gadget vendors.</string>
<string name="first_start_overview_title">Overview</string> <string name="first_start_overview_title">Overview</string>
@ -3424,9 +3427,53 @@
<string name="first_start_permissions_title">Permissions</string> <string name="first_start_permissions_title">Permissions</string>
<string name="first_start_permissions_desc">Gadgetbridge needs a lot of permissions to perform all its functions. Review the permissions and their purposes below.</string> <string name="first_start_permissions_desc">Gadgetbridge needs a lot of permissions to perform all its functions. Review the permissions and their purposes below.</string>
<string name="first_start_permissions_request_all_button">Request all permissions</string> <string name="first_start_permissions_request_all_button">Request all permissions</string>
<string name="first_start_permissions_request_button">Request</string>
<string name="first_start_get_started_title">Get started</string> <string name="first_start_get_started_title">Get started</string>
<string name="first_start_get_started_desc">To get started, add your first device directly from this screen, restore a backup or start with a clean database.</string> <string name="first_start_get_started_desc">To get started, add your first device directly from this screen, restore a backup or start with a clean database.</string>
<string name="first_start_get_started_add_first_device_button">Add first device</string> <string name="first_start_get_started_add_first_device_button">Add first device</string>
<string name="first_start_get_started_restore_button">Restore backup</string> <string name="first_start_get_started_restore_button">Restore backup</string>
<string name="first_start_get_started_go_to_app_button">Go to the app</string> <string name="first_start_get_started_go_to_app_button">Go to the app</string>
<string name="permission_notifications_summary">Forwarding notifications to connected gadgets</string>
<string name="permission_manage_dnd_title">Manage Do Not Disturb</string>
<string name="permission_manage_dnd_summary">Changing DND notification policy</string>
<string name="permission_displayover_title">Display over other apps</string>
<string name="permission_displayover_summary">Used by Bangle.js for starting apps and other functionality on your phone</string>
<string name="permission_fine_location_title">Fine location</string>
<string name="permission_fine_location_summary">Scanning for Bluetooth devices</string>
<string name="permission_background_location_title">Background location</string>
<string name="permission_background_location_summary">Scanning for Bluetooth devices in the background and sending the location to certain gadgets</string>
<string name="permission_bluetooth_title">Bluetooth</string>
<string name="permission_bluetooth_summary">Connecting to Bluetooth devices</string>
<string name="permission_bluetooth_admin_title">Bluetooth admin</string>
<string name="permission_bluetooth_admin_summary">Discovering and pairing Bluetooth devices</string>
<string name="permission_bluetooth_scan_title">Bluetooth scan</string>
<string name="permission_bluetooth_scan_summary">Scanning for new Bluetooth devices</string>
<string name="permission_bluetooth_connect_title">Bluetooth connect</string>
<string name="permission_bluetooth_connect_summary">Connecting to already-paired Bluetooth devices</string>
<string name="permission_post_notification_title">Post notifications</string>
<string name="permission_post_notification_summary">Posting ongoing notification which keeps the service running</string>
<string name="permission_internet_access_title">Internet access</string>
<string name="permission_internet_access_summary">Synchronization with online resources</string>
<string name="permission_contacts_title">Contacts</string>
<string name="permission_contacts_summary">Sending contacts to gadgets</string>
<string name="permission_calendar_title">Calendar</string>
<string name="permission_calendar_summary">Sending calendar to gadgets</string>
<string name="permission_receive_sms_title">Receive SMS</string>
<string name="permission_receive_sms_summary">Forwarding SMS messages to gadgets</string>
<string name="permission_send_sms_title">Send SMS</string>
<string name="permission_send_sms_summary">Sending SMS (canned response) from gadgets</string>
<string name="permission_read_call_log_title">Read call log</string>
<string name="permission_read_call_log_summary">Forwarding call log to gadgets</string>
<string name="permission_read_phone_state_title">Read phone state</string>
<string name="permission_read_phone_state_summary">Reading status of ongoing calls</string>
<string name="permission_call_phone_title">Call phone</string>
<string name="permission_call_phone_summary">Initiating phone calls from gadgets</string>
<string name="permission_process_outgoing_calls_title">Process outgoing calls</string>
<string name="permission_process_outgoing_calls_summary">Reading the number of an outgoing call to display it on a gadget</string>
<string name="permission_answer_phone_calls_title">Answer phone calls</string>
<string name="permission_answer_phone_calls_summary">Answering phone calls from gadgets</string>
<string name="permission_external_storage_title">External storage</string>
<string name="permission_external_storage_summary">Using images, ringtones, app files and more</string>
<string name="permission_query_all_packages_title">Query all packages</string>
<string name="permission_query_all_packages_summary">Reading names and icons of all installed apps</string>
</resources> </resources>