Skip to content
This repository has been archived by the owner on Jan 26, 2020. It is now read-only.

Commit

Permalink
something for Google Play version
Browse files Browse the repository at this point in the history
add translation
  • Loading branch information
RikkaW committed Jan 27, 2016
1 parent 02f32b4 commit 0c01934
Show file tree
Hide file tree
Showing 9 changed files with 143 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import java.util.List;
import java.util.ListIterator;

import rikka.searchbyimage.BuildConfig;
import rikka.searchbyimage.database.DatabaseHelper;
import rikka.searchbyimage.database.table.CustomEngineTable;
import rikka.searchbyimage.utils.ParcelableUtils;
Expand Down Expand Up @@ -153,7 +154,7 @@ private static void addBuildInEngines(Context context, List<CustomEngine> list)
ids[item.id] = true;
}

for (int i = 0; i < 6; i++) {
for (int i = 0; i < (BuildConfig.hideOtherEngine ? 1 : 6); i++) {
if (!ids[i]) {
CustomEngineParcelable parcelable = new CustomEngineParcelable();
parcelable.data.id = i;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void onItemLongClick(View view, final int position, final int realPositio

new AlertDialog.Builder(mActivity)
.setItems(
new CharSequence[] {"Delete"},
new CharSequence[] {getString(R.string.delete)},
new DialogInterface.OnClickListener()
{
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ public void onCreatePreferences(Bundle bundle, String s) {
boolean popup = getArguments().getBoolean("popup");

if (popup) {
if (!BuildConfig.hideOtherEngine)
//if (!BuildConfig.hideOtherEngine)
addPreferencesFromResource(R.xml.preferences_general_mini);

addPreferencesFromResource(R.xml.preferences_search_settings);
} else {
addPreferencesFromResource(R.xml.preferences_usage);
addPreferencesFromResource(BuildConfig.hideOtherEngine ? R.xml.preferences_general_gp : R.xml.preferences_general);
addPreferencesFromResource(/*BuildConfig.hideOtherEngine ? R.xml.preferences_general_gp : */R.xml.preferences_general);
addPreferencesFromResource(R.xml.preferences_search_settings);
addPreferencesFromResource(R.xml.preferences_about);
}
Expand Down Expand Up @@ -125,14 +125,23 @@ public void onCreatePreferences(Bundle bundle, String s) {

if (!popup)
{
/*SharedPreferences sharedPreferences = getPreferenceManager().getSharedPreferences();
if (sharedPreferences.getBoolean("developer", false)) {
mScreen.addPreference(mCategoryAdvance);
} else {
mScreen.removePreference(mCategoryAdvance);
}*/

Preference versionPref = findPreference("version");
versionPref.setOnPreferenceClickListener(this);

Preference githubPref = findPreference("open_source");
githubPref.setOnPreferenceClickListener(this);

Preference advancePref = findPreference("advance");
advancePref.setOnPreferenceClickListener(this);
if (advancePref != null) {
advancePref.setOnPreferenceClickListener(this);
}

Preference donatePref = findPreference("donate");
if (BuildConfig.hideOtherEngine) {
Expand Down Expand Up @@ -231,12 +240,6 @@ private void setCustomGoogleUriHide() {
private void setSearchEngineHide() {
SharedPreferences sharedPreferences = getPreferenceManager().getSharedPreferences();

if (sharedPreferences.getBoolean("developer", false)) {
mScreen.addPreference(mCategoryAdvance);
} else {
mScreen.removePreference(mCategoryAdvance);
}

int siteId = Integer.parseInt(sharedPreferences.getString("search_engine_preference", "0"));

switch (siteId) {
Expand Down Expand Up @@ -318,10 +321,14 @@ else if (click == 40) {

click = -10;

SharedPreferences sharedPreferences = getPreferenceManager().getSharedPreferences();
/*SharedPreferences sharedPreferences = getPreferenceManager().getSharedPreferences();
sharedPreferences.edit().putBoolean("developer", true).apply();
mScreen.addPreference(mCategoryAdvance);
Preference advancePref = findPreference("advance");
if (advancePref != null) {
advancePref.setOnPreferenceClickListener(this);
}*/
/*View view = mActivity.findViewById(R.id.settings_container);
view.animate()
.rotation(view.getRotation() + 180 + 360)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_add_engine.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
android:id="@+id/edit_url"
android:layout_marginLeft="16dp"
android:inputType="textUri"
android:hint="@string/upload_url"
android:hint="@string/request_url"
android:layout_gravity="center_vertical"
android:minLines="1" />
</LinearLayout>
Expand Down
22 changes: 22 additions & 0 deletions app/src/main/res/values-ja/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,26 @@
<string name="app_crash_no_email_client">メールアプリ見つかりません。</string>
<string name="baidu_settings">Baidu設定</string>

<string name="edit_sites">Search engines</string>
<string name="edit_site">Edit data</string>
<string name="request_url">Request url</string>
<string name="engine_name">Name</string>
<string name="upload_form_key">Key</string>
<string name="upload_form_value">Value</string>
<string name="upload_form_your_image">(image)</string>
<string name="upload_form_built_in_selector">(selector)</string>
<string name="upload_form_add">New form data</string>
<string name="built_in">Built-in</string>
<string name="custom">Custom</string>
<string name="check_your_data">Check your data</string>
<string name="choose_one">Please enable at least one search engine</string>

<string name="open_url">Open URL</string>
<string name="open_html">Open saved HTML file in WebView</string>
<string name="open_iqdb">Built-in viewer for iqdb.org</string>

<string name="advance">Advance</string>
<string name="custom_search_engine">Custom search engines</string>
<string name="help">Help</string>
<string name="delete">Delete</string>
</resources>
23 changes: 23 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,27 @@
<string name="app_crash_send_cancel">取消</string>
<string name="app_crash_no_email_client">唉..没有邮件客户端的样子..</string>
<string name="baidu_settings">百度设置</string>

<string name="edit_sites">搜索引擎</string>
<string name="edit_site">编辑数据</string>
<string name="request_url">请求URL</string>
<string name="engine_name">名称</string>
<string name="upload_form_key">Key</string>
<string name="upload_form_value">Value</string>
<string name="upload_form_your_image">(图片)</string>
<string name="upload_form_built_in_selector">(选择器)</string>
<string name="upload_form_add">添加表单数据</string>
<string name="built_in">内置</string>
<string name="custom">自定义</string>
<string name="check_your_data">请检查你的数据</string>
<string name="choose_one">请至少启用一个搜索引擎</string>

<string name="open_url">打开URL</string>
<string name="open_html">在WebView中打开保存的HTML文件</string>
<string name="open_iqdb">内置iqdb.org结果查看器</string>

<string name="advance">高级</string>
<string name="custom_search_engine">自定义搜索引擎</string>
<string name="help">帮助</string>
<string name="delete">删除</string>
</resources>
77 changes: 50 additions & 27 deletions app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<string name="general">通用</string>
<string name="safe_search_summary">阻止不合適的圖片</string>
<string name="rate">評分</string>
<string name="rate_summary">能给5星就太好啦 &gt;&lt;</string>
<string name="rate_summary">能給5星就太好啦 &gt;&lt;</string>
<string name="build_version">版本</string>

<string name="google_settings">Google 設定</string>
Expand All @@ -41,31 +41,31 @@

<string name="save_link">保存連接</string>
<string name="save_image">保存圖片</string>
<string name="open_with">用其他应用打开…</string>
<string name="open">打开</string>
<string name="open_with">用其他軟體打開…</string>
<string name="open">打開</string>

<string name="share">分享</string>
<string name="share_url">选择分享方式</string>
<string name="share_url">選擇分享方式</string>

<string name="use_chrome_custom_tabs">使用內建瀏覽器</string>
<string name="use_chrome_custom_tabs_summary">使用 WebView 或 Chrome custom tabs</string>

<string name="search_result">%s 搜尋結果</string>

<string name="settings">設定</string>
<string name="setting_each_time">上載前打開設置</string>
<string name="resize_image">压缩上載圖片</string>
<string name="try_resize_image_if_error">当图片不能正常上传时可尝试此选项</string>
<string name="start_upload">開始上載</string>
<string name="setting_each_time">上傳前打開設置</string>
<string name="resize_image">壓縮上傳圖片</string>
<string name="try_resize_image_if_error">當圖片不能正常上傳時可嘗試此選項</string>
<string name="start_upload">開始上傳</string>

<string name="permission_require">需要权限</string>
<string name="permission_require_detail">您需要授予應用“讀取外部存儲”權限才能上載該圖片。</string>
<string name="permission_require">需要權限</string>
<string name="permission_require_detail">您需要授予軟體“讀取外部存儲”權限才能上傳該圖片。</string>
<string name="get_permission">獲取權限</string>

<string name="donate">捐赠</string>
<string name="donate">捐贈</string>
<string name="donate_summary">Google Wallet/Alipay: rikka@xing.moe</string>

<string name="something_wrong">出错了 OAO</string>
<string name="something_wrong">出錯了 OAO</string>

<string name="saucenao_settings">SauceNAO 設定</string>
<string name="saucenao_hide_title">隱藏</string>
Expand All @@ -77,22 +77,22 @@
<item>已知和預估危險來源</item>
<item>除了已知安全來源</item>
</string-array>
<string name="timeout_exception">连接超时</string>
<string name="socket_exception">网络错误</string>
<string name="unknown_host_exception">域名解析错误</string>
<string name="timeout_exception">連線超時</string>
<string name="socket_exception">網路錯誤</string>
<string name="unknown_host_exception">域名解析錯誤</string>

<string name="notice">注意</string>
<string name="notice_baidu">Baidu不支持WebP格式和较大图片</string>
<string name="notice_baidu">Baidu不支持WebP格式和較大圖片</string>

<string name="show_result_in">结果打开方式</string>
<string name="show_result_in">结果打開方式</string>
<string name="build_in_browser">內建瀏覽器</string>
<string name="chrome_custom_tabs">Chrome custom tabs</string>
<string name="browser_app">瀏覽器应用</string>
<string name="browser_app">瀏覽器軟體</string>
<string name="search_this_image_by_google">使用 Google 搜尋此圖片</string>
<string name="refresh">刷新</string>
<string name="copy_link">拷貝鏈接</string>
<string name="open_in_browser">在瀏覽器中打开</string>
<string name="copy_to_clipboard">%s 已拷貝到剪貼板</string>
<string name="refresh">重新整理</string>
<string name="copy_link">複製連接</string>
<string name="open_in_browser">在瀏覽器中打開</string>
<string name="copy_to_clipboard">%s 已複製到剪貼板</string>

<string name="save_failed">保存失敗</string>
<string name="downloaded">%s 下載完成</string>
Expand All @@ -102,12 +102,35 @@
<string name="create_new_file">建立新檔案</string>
<string name="file_overwrite" formatted="false"><![CDATA[您要取代「<b>%2$s</b>」目錄中現有的 <b>%1$s</b> 嗎?]]></string>

<string name="send_via">发送方式</string>
<string name="send_via">發送方式</string>

<string name="app_crash_title">坏掉了 QAQ</string>
<string name="app_crash_message">使用邮件客户端发送错误报告给开发者以帮助解决问题。</string>
<string name="app_crash_send_email">确定</string>
<string name="app_crash_title">壞掉了 QAQ</string>
<string name="app_crash_message">使用Email發送錯誤報告給開發者以幫助解決問題。</string>
<string name="app_crash_send_email">確定</string>
<string name="app_crash_send_cancel">取消</string>
<string name="app_crash_no_email_client">唉..没有邮件客户端的样子..</string>
<string name="app_crash_no_email_client">唉..没有Email軟體的樣子..</string>
<string name="baidu_settings">Baidu 設定</string>

<string name="edit_sites">搜索引擎</string>
<string name="edit_site">编辑数据</string>
<string name="request_url">请求URL</string>
<string name="engine_name">名称</string>
<string name="upload_form_key">Key</string>
<string name="upload_form_value">Value</string>
<string name="upload_form_your_image">(图片)</string>
<string name="upload_form_built_in_selector">(选择器)</string>
<string name="upload_form_add">添加表单数据</string>
<string name="built_in">内置</string>
<string name="custom">自定义</string>
<string name="check_your_data">请检查你的数据</string>
<string name="choose_one">请至少启用一个搜索引擎</string>

<string name="open_url">打开URL</string>
<string name="open_html">在WebView中打开保存的HTML文件</string>
<string name="open_iqdb">内置iqdb.org结果查看器</string>

<string name="advance">高级</string>
<string name="custom_search_engine">自定义搜索引擎</string>
<string name="help">帮助</string>
<string name="delete">删除</string>
</resources>
10 changes: 5 additions & 5 deletions app/src/main/res/values/array.xml
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,13 @@
</string-array>

<string-array name="custom_open_with" translatable="false">
<item>Open URL</item>
<item>Open saved HTML file in WebView</item>
<item>@string/open_url</item>
<item>@string/open_html</item>
</string-array>

<string-array name="custom_open_with_in_app" translatable="false">
<item>Open URL</item>
<item>Open saved HTML file in WebView</item>
<item>Build-in viewer for iqdb.org</item>
<item>@string/open_url</item>
<item>@string/open_html</item>
<item>@string/open_iqdb</item>
</string-array>
</resources>
40 changes: 22 additions & 18 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,26 @@
<string name="app_crash_no_email_client">No mail app installed</string>
<string name="baidu_settings">Baidu settings</string>

<string name="edit_sites" translatable="false">Edit engines</string>
<string name="edit_site" translatable="false">Edit data</string>
<string name="upload_url" translatable="false">Upload url</string>
<string name="engine_name" translatable="false">Name</string>
<string name="upload_form_key" translatable="false">Key</string>
<string name="upload_form_value" translatable="false">Value</string>
<string name="upload_form_your_image" translatable="false">(image)</string>
<string name="upload_form_built_in_selector" translatable="false">(selector)</string>
<string name="upload_form_add" translatable="false">New form data</string>
<string name="built_in" translatable="false">Built-in</string>
<string name="custom" translatable="false">Custom</string>
<string name="check_your_data" translatable="false">Check your data</string>
<string name="choose_one" translatable="false">Please enable at least one search engine</string>

<string name="advance" translatable="false">Advance</string>
<string name="custom_search_engine" translatable="false">Custom search engines</string>
<string name="help" translatable="false">Help</string>

<string name="edit_sites">Search engines</string>
<string name="edit_site">Edit data</string>
<string name="request_url">Request url</string>
<string name="engine_name">Name</string>
<string name="upload_form_key">Key</string>
<string name="upload_form_value">Value</string>
<string name="upload_form_your_image">(image)</string>
<string name="upload_form_built_in_selector">(selector)</string>
<string name="upload_form_add">New form data</string>
<string name="built_in">Built-in</string>
<string name="custom">Custom</string>
<string name="check_your_data">Check your data</string>
<string name="choose_one">Please enable at least one search engine</string>

<string name="open_url">Open URL</string>
<string name="open_html">Open saved HTML file in WebView</string>
<string name="open_iqdb">Built-in viewer for iqdb.org</string>

<string name="advance">Advance</string>
<string name="custom_search_engine">Custom search engines</string>
<string name="help">Help</string>
<string name="delete">Delete</string>
</resources>

0 comments on commit 0c01934

Please sign in to comment.