瀏覽代碼

extract string resource

Signed-off-by: Felix Nüsse <felix.nuesse@t-online.de>
Felix Nüsse 2 年之前
父節點
當前提交
ea2a1a9163
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 2 1
      app/src/main/java/com/nextcloud/utils/ShortcutUtil.kt
  2. 1 0
      app/src/main/res/values/strings.xml

+ 2 - 1
app/src/main/java/com/nextcloud/utils/ShortcutUtil.kt

@@ -80,9 +80,10 @@ class ShortcutUtil @Inject constructor(private val mContext: Context) {
                     MimeTypeUtil.getFileTypeIconId(file.mimeType, file.fileName)
                     MimeTypeUtil.getFileTypeIconId(file.mimeType, file.fileName)
                 )
                 )
             }
             }
+            val longLabel = mContext.getString(R.string.pin_shortcut_label, file.fileName)
             val pinShortcutInfo = ShortcutInfoCompat.Builder(mContext, shortcutId)
             val pinShortcutInfo = ShortcutInfoCompat.Builder(mContext, shortcutId)
                 .setShortLabel(file.fileName)
                 .setShortLabel(file.fileName)
-                .setLongLabel("Open " + file.fileName)
+                .setLongLabel(longLabel)
                 .setIcon(icon)
                 .setIcon(icon)
                 .setIntent(intent)
                 .setIntent(intent)
                 .build()
                 .build()

+ 1 - 0
app/src/main/res/values/strings.xml

@@ -1055,4 +1055,5 @@
     <string name="e2e_not_yet_setup">E2E not yet setup</string>
     <string name="e2e_not_yet_setup">E2E not yet setup</string>
     <string name="error_file_actions">Error showing file actions</string>
     <string name="error_file_actions">Error showing file actions</string>
     <string name="pin_home">Pin to Home screen</string>
     <string name="pin_home">Pin to Home screen</string>
+    <string name="pin_shortcut_label">Open %1$s</string>
 </resources>
 </resources>