<string name="app_name">QuickDic</string>
- <string name="titleWithVersion">QuickDic 4.0.1</string>
+ <string name="titleWithVersion">QuickDic 5.0.0</string>
<!-- Global. -->
<string name="about">Über QuickDic…</string>
<string name="deleteDictionary">Wörterbuch entfernen</string>
<string name="indexInfo">%1$s: %2$,d Wörter</string>
<string name="managerFilterText">Filter</string>
- <string name="managerFilterCheckbox">Nur SD-Karte</string>
-
+ <string name="managerFilterCheckbox">Nur SD-Karte</string>
+
<string name="thanksForUpdatingVersion">4.0.1_de_b</string>
<!-- DictionaryActivity -->
<string name="app_name">QuickDic</string>
- <string name="titleWithVersion">QuickDic 4.0.1</string>
+ <string name="titleWithVersion">QuickDic 5.0.0</string>
<!-- Global. -->
<string name="about">About QuickDic…</string>
<string name="settings">Settings…</string>
<string name="help">Help</string>
<string name="reportIssue">Report issue…</string>
- <string name="fontWorkaround">Detected font problem (common on Sony Ericsson devices), switching back to default font.</string>
<string name="no_dict_file">Please specify a default directory in the settings.</string>
<!-- DictionaryManagerActivity -->
<string name="dictionaryManager">Dictionary manager</string>
<string name="dictionariesOnDevice">Dictionaries on device</string>
- <string name="noDictionariesOnDevice">No dictionaries on device</string>
<string name="downloadableDictionaries">Downloadable dictionaries</string>
<string name="downloadButton">%.1fMB</string>
<string name="updateAvailable">UPDATE!</string>
<string name="moveToTop">Move to top</string>
<string name="deleteDictionary">Delete dictionary</string>
<string name="indexInfo">%1$s: %2$,d words</string>
- <string name="managerFilterText">List filter</string>
<string name="managerShow">Show</string>
<string name="managerHide">Hide</string>
<string name="unableToReadDictionaryDir">Unable to read dictionary directory: \n%1$s\n\nAndroid external storage directory: \n%2$s</string>
<!-- Download. -->
- <string name="downloadFinished">Download finished: \n%s.</string>
<string name="downloadFailed">Download failed: \n%s.</string>
+ <string name="unzippingDictionary">Unzipping dictionary: \n%s</string>
+ <string name="unzippingFailed">Unzipping failed: \n%s</string>
+ <string name="installationFinished">Installation finished: \n%s.</string>
<!-- DictionaryActivity -->
<string name="searchText">Search Text</string>
<string name="selectDictionary">Select dictionary…</string>
- <string name="switchToLanguage">Switch to %s</string>
<string name="addToWordList">Add to word list: %s</string>
<string name="searchForSelection">Search: %s</string>
<string name="failedAddingToWordList">Failure adding to word list: %s</string>
- <string name="unzippingDictionary">Unzipping dictionary…</string>
- <string name="failedToUnzipDictionary">Failed to unzip dictionary…</string>
<string name="invalidDictionary">Invalid dictionary: file=%1$s, error=%2$s</string>
<string name="noSearchResults">No search results.</string>
<string name="aboutDictionary">About dictionary…</string>
- <string name="randomWord">Random word</string>
<string name="fontFailure">Font failure: %s</string>
<string name="seeAlso">See also: %1$s (%2$s)</string>
<string name="speak">Speak</string>
<!-- About. -->
- <string name="thadHughes">Thad Hughes</string>
<string name="contactMe">If you\'re using QuickDic, I\'d love to hear from you.
Unfortunately, I cannot take responsibility for dictionary content (other than formatting), as it is generated from other sources.
Please send comments, suggestions, bug reports, or just a quick hello to:</string>
<string name="defaultDicTitle">Default Dic</string>
<string name="defaultDicSummary">The directory to fired up when nothing else mentioned.</string>
-
<string name="quickdicDirectoryKey">quickdicDirectory</string>
<string name="quickdicDirectoryTitle">QuickDic directory</string>
<string name="quickdicDirectorySummary">The directory where QuickDic stores dictionaries (empty for default quickDic folder on external storage).</string>
package com.hughes.android.dictionary;
import android.app.AlertDialog;
-import android.app.Dialog;
import android.app.DownloadManager;
import android.app.DownloadManager.Request;
import android.content.BroadcastReceiver;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
-import android.view.View.OnLongClickListener;
-import android.view.inputmethod.EditorInfo;
import android.view.ViewGroup;
+import android.view.inputmethod.EditorInfo;
import android.widget.AdapterView.AdapterContextMenuInfo;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.CompoundButton;
-import android.widget.FrameLayout;
-import android.widget.ImageView;
-import android.widget.ListView;
-import android.widget.Toast;
import android.widget.CompoundButton.OnCheckedChangeListener;
+import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
+import android.widget.Toast;
import android.widget.ToggleButton;
import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.SherlockListActivity;
import com.actionbarsherlock.view.Menu;
-import com.actionbarsherlock.view.MenuInflater;
import com.actionbarsherlock.widget.SearchView;
import com.actionbarsherlock.widget.SearchView.OnQueryTextListener;
import com.hughes.android.dictionary.DictionaryInfo.IndexInfo;
}
Log.w(LOG, "Download finished: " + dest);
+ Toast.makeText(context, getString(R.string.unzippingDictionary, dest),
+ Toast.LENGTH_LONG).show();
+
+
final File localZipFile = new File(Uri.parse(dest).getPath());
-
try {
ZipFile zipFile = new ZipFile(localZipFile);
final ZipEntry zipEntry = zipFile.entries().nextElement();
Log.d(LOG, "Unzipping entry: " + zipEntry.getName());
final InputStream zipIn = zipFile.getInputStream(zipEntry);
- final OutputStream zipOut = new FileOutputStream(
- new File(application.getDictDir(), zipEntry.getName()));
+ File targetFile = new File(application.getDictDir(), zipEntry.getName());
+ if (targetFile.exists()) {
+ targetFile.renameTo(new File(targetFile.getAbsolutePath().replace(".quickdic", "bak.quickdic")));
+ targetFile = new File(application.getDictDir(), zipEntry.getName());
+ }
+ final OutputStream zipOut = new FileOutputStream(targetFile);
copyStream(zipIn, zipOut);
zipFile.close();
application.backgroundUpdateDictionaries(dictionaryUpdater);
- Toast.makeText(context, getString(R.string.downloadFinished, dest),
+ Toast.makeText(context, getString(R.string.installationFinished, dest),
Toast.LENGTH_LONG).show();
} catch (Exception e) {
- Toast.makeText(context, getString(R.string.downloadFailed, dest),
+ Toast.makeText(context, getString(R.string.unzippingFailed, dest),
Toast.LENGTH_LONG).show();
Log.e(LOG, "Failed to unzip.", e);
} finally {
* Internationalize strings.
-* Back button in top left
+* Back button and actionbar button.
* HtmlEntries inline, expandable.
\ No newline at end of file