Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Android] Externalize how the formatting is used in the file size str…
…ing, the file clicked string, and the current dir string.
  • Loading branch information
lioncash committed Oct 1, 2013
1 parent 80a4cbd commit 16fb0b0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Source/Android/res/values-ja/strings.xml
Expand Up @@ -13,9 +13,9 @@
<string name="supports_gles3">サポートのOpenGL ES 3</string>

<!-- Folder Browser -->
<string name="current_dir">現在のディレクトリ: </string>
<string name="current_dir">現在のディレクトリ: %1$s</string>
<string name="parent_directory">親ディレクトリ</string>
<string name="file_size">ファイルサイズ: </string>
<string name="file_size">ファイルサイズ: %1$s</string>

<!-- Game List Activity -->
<string name="clear_game_list">クリア</string>
Expand All @@ -26,7 +26,7 @@
<string name="about">について</string>

<!-- Game List Fragment -->
<string name="file_clicked">クリックされたファイル: </string>
<string name="file_clicked">クリックされたファイル: %1$s</string>

<!-- Emulation Window Overlay -->
<string name="overlay_savestate">ステートセーブ</string>
Expand Down
6 changes: 3 additions & 3 deletions Source/Android/res/values/strings.xml
Expand Up @@ -13,9 +13,9 @@
<string name="supports_gles3">Supports OpenGL ES 3</string>

<!-- 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="file_size">File Size: </string>
<string name="file_size">File Size: %1$s</string>

<!-- Game List Activity -->
<string name="clear_game_list">Clear game list</string>
Expand All @@ -26,7 +26,7 @@
<string name="about">About</string>

<!-- Game List Fragment -->
<string name="file_clicked">File clicked: </string>
<string name="file_clicked">File clicked: %1$s</string>

<!-- Emulation Overlay -->
<string name="overlay_savestate">Save State</string>
Expand Down
Expand Up @@ -46,7 +46,7 @@ public final class FolderBrowser extends ListFragment
// Populates the FolderView with the given currDir's contents.
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();
List<FolderBrowserItem> dir = new ArrayList<FolderBrowserItem>();
List<FolderBrowserItem> fls = new ArrayList<FolderBrowserItem>();
Expand Down Expand Up @@ -76,7 +76,7 @@ else if (entry.isFile() && hasExtension)
{
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()));
}
}
}
Expand Down
Expand Up @@ -86,7 +86,7 @@ private void Fill()
if (!entry.isHidden() && !entry.isDirectory())
{
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()));
}
}
}
Expand Down Expand Up @@ -128,7 +128,7 @@ public void onItemClick(AdapterView<?> parent, View view, int position, long id)

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.putExtra("SelectedGame", o);
Expand Down

0 comments on commit 16fb0b0

Please sign in to comment.