[Android] Externalize how the formatting is used in the file size string, the file clicked string, and the current dir string.

This commit is contained in:
lioncash 2013-10-01 10:32:05 -04:00
parent 80a4cbdbb4
commit 16fb0b04d8
4 changed files with 10 additions and 10 deletions

View File

@ -13,9 +13,9 @@
<string name="supports_gles3">サポートのOpenGL ES 3</string> <string name="supports_gles3">サポートのOpenGL ES 3</string>
<!-- Folder Browser --> <!-- Folder Browser -->
<string name="current_dir">現在のディレクトリ: </string> <string name="current_dir">現在のディレクトリ: %1$s</string>
<string name="parent_directory">親ディレクトリ</string> <string name="parent_directory">親ディレクトリ</string>
<string name="file_size">ファイルサイズ: </string> <string name="file_size">ファイルサイズ: %1$s</string>
<!-- Game List Activity --> <!-- Game List Activity -->
<string name="clear_game_list">クリア</string> <string name="clear_game_list">クリア</string>
@ -26,7 +26,7 @@
<string name="about">について</string> <string name="about">について</string>
<!-- Game List Fragment --> <!-- Game List Fragment -->
<string name="file_clicked">クリックされたファイル: </string> <string name="file_clicked">クリックされたファイル: %1$s</string>
<!-- Emulation Window Overlay --> <!-- Emulation Window Overlay -->
<string name="overlay_savestate">ステートセーブ</string> <string name="overlay_savestate">ステートセーブ</string>

View File

@ -13,9 +13,9 @@
<string name="supports_gles3">Supports OpenGL ES 3</string> <string name="supports_gles3">Supports OpenGL ES 3</string>
<!-- Folder Browser --> <!-- Folder Browser -->
<string name="current_dir">Current Dir: </string> <string name="current_dir">Current Dir: %1$s</string>
<string name="parent_directory">Parent Directory</string> <string name="parent_directory">Parent Directory</string>
<string name="file_size">File Size: </string> <string name="file_size">File Size: %1$s</string>
<!-- Game List Activity --> <!-- Game List Activity -->
<string name="clear_game_list">Clear game list</string> <string name="clear_game_list">Clear game list</string>
@ -26,7 +26,7 @@
<string name="about">About</string> <string name="about">About</string>
<!-- Game List Fragment --> <!-- Game List Fragment -->
<string name="file_clicked">File clicked: </string> <string name="file_clicked">File clicked: %1$s</string>
<!-- Emulation Overlay --> <!-- Emulation Overlay -->
<string name="overlay_savestate">Save State</string> <string name="overlay_savestate">Save State</string>

View File

@ -46,7 +46,7 @@ public final class FolderBrowser extends ListFragment
// Populates the FolderView with the given currDir's contents. // Populates the FolderView with the given currDir's contents.
private void Fill(File currDir) private void Fill(File currDir)
{ {
m_activity.setTitle(getString(R.string.current_dir) + currDir.getName()); m_activity.setTitle(String.format(getString(R.string.current_dir), currDir.getName()));
File[] dirs = currDir.listFiles(); File[] dirs = currDir.listFiles();
List<FolderBrowserItem> dir = new ArrayList<FolderBrowserItem>(); List<FolderBrowserItem> dir = new ArrayList<FolderBrowserItem>();
List<FolderBrowserItem> fls = new ArrayList<FolderBrowserItem>(); List<FolderBrowserItem> fls = new ArrayList<FolderBrowserItem>();
@ -76,7 +76,7 @@ public final class FolderBrowser extends ListFragment
{ {
if (validExts.contains(entryName.toLowerCase().substring(entryName.lastIndexOf('.')))) if (validExts.contains(entryName.toLowerCase().substring(entryName.lastIndexOf('.'))))
{ {
fls.add(new FolderBrowserItem(entryName, getString(R.string.file_size)+entry.length(), entry.getAbsolutePath())); fls.add(new FolderBrowserItem(entryName, String.format(getString(R.string.file_size), entry.length()), entry.getAbsolutePath()));
} }
} }
} }

View File

@ -86,7 +86,7 @@ public final class GameListFragment extends Fragment
if (!entry.isHidden() && !entry.isDirectory()) if (!entry.isHidden() && !entry.isDirectory())
{ {
if (exts.contains(entryName.toLowerCase().substring(entryName.lastIndexOf('.')))) if (exts.contains(entryName.toLowerCase().substring(entryName.lastIndexOf('.'))))
fls.add(new GameListItem(mMe, entryName, getString(R.string.file_size)+entry.length(),entry.getAbsolutePath())); fls.add(new GameListItem(mMe, entryName, String.format(getString(R.string.file_size), entry.length()), entry.getAbsolutePath()));
} }
} }
} }
@ -128,7 +128,7 @@ public final class GameListFragment extends Fragment
private void onFileClick(String o) private void onFileClick(String o)
{ {
Toast.makeText(mMe, getString(R.string.file_clicked) + o, Toast.LENGTH_SHORT).show(); Toast.makeText(mMe, String.format(getString(R.string.file_clicked), o), Toast.LENGTH_SHORT).show();
Intent intent = new Intent(mMe, EmulationActivity.class); Intent intent = new Intent(mMe, EmulationActivity.class);
intent.putExtra("SelectedGame", o); intent.putExtra("SelectedGame", o);