Skip to content

Commit f9cf6b9

Browse files
committed
update string
1 parent e52972d commit f9cf6b9

File tree

12 files changed

+96
-90
lines changed

12 files changed

+96
-90
lines changed

app/src/main/java/com/duy/pascal/frontend/code/ExceptionManager.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
import com.duy.pascal.interperter.exceptions.parsing.io.LibraryNotFoundException;
5454
import com.duy.pascal.interperter.exceptions.parsing.missing.MissingCommaTokenException;
5555
import com.duy.pascal.interperter.exceptions.parsing.missing.MissingSemicolonTokenException;
56+
import com.duy.pascal.interperter.exceptions.parsing.missing.MissingTokenException;
5657
import com.duy.pascal.interperter.exceptions.parsing.operator.BadOperationTypeException;
5758
import com.duy.pascal.interperter.exceptions.parsing.operator.ConstantCalculationException;
5859
import com.duy.pascal.interperter.exceptions.parsing.operator.DivisionByZeroException;
@@ -99,13 +100,16 @@ public Spanned getMessage(Throwable e) {
99100
if (e instanceof StackOverflowException)
100101
return getMessageResource(e, R.string.StackOverflowException);
101102

102-
if (e instanceof MissingSemicolonTokenException)
103+
if (e instanceof MissingSemicolonTokenException) {
103104
return getMessageResource(e, R.string.MissingSemicolonTokenException,
104105
((MissingSemicolonTokenException) e).getLineInfo().getLine());
105-
106-
if (e instanceof MissingCommaTokenException)
106+
} else if (e instanceof MissingCommaTokenException) {
107107
return getMessageResource(e, R.string.MissingCommaTokenException,
108108
((MissingCommaTokenException) e).getLineInfo().getLine());
109+
} else if (e instanceof MissingTokenException) {
110+
return getMessageResource(e, R.string.missing_token_exception,
111+
((MissingTokenException) e).getMissingToken());
112+
}
109113

110114
if (e instanceof StrayCharacterException)
111115
return getMessageResource(e, R.string.StrayCharacterException,
@@ -146,8 +150,9 @@ public Spanned getMessage(Throwable e) {
146150
if (e instanceof MethodCallException) return getPluginCallException(e);
147151
if (e instanceof NonIntegerIndexException) return getNonIntegerIndexException(e);
148152
if (e instanceof NonIntegerException) return getNonIntegerException(e);
149-
if (e instanceof ConstantCalculationException)
153+
if (e instanceof ConstantCalculationException) {
150154
return getConstantCalculationException(e);
155+
}
151156

152157
if (e instanceof ChangeValueConstantException) {
153158
return getMessageResource(e, R.string.ChangeValueConstantException);
@@ -228,7 +233,6 @@ public Spanned getMessage(Throwable e) {
228233
}
229234
return new SpannableString(e.getLocalizedMessage());
230235
} catch (Exception err) {
231-
// FirebaseCrash.report(new Throwable("Error when get exception msg"));
232236
return new SpannableString(err.toString());
233237
}
234238
}
Lines changed: 62 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,62 @@
1-
/*
2-
* Copyright (c) 2017 Tran Le Duy
3-
*
4-
* Licensed under the Apache License, Version 2.0 (the "License");
5-
* you may not use this file except in compliance with the License.
6-
* You may obtain a copy of the License at
7-
*
8-
* http://www.apache.org/licenses/LICENSE-2.0
9-
*
10-
* Unless required by applicable law or agreed to in writing, software
11-
* distributed under the License is distributed on an "AS IS" BASIS,
12-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
* See the License for the specific language governing permissions and
14-
* limitations under the License.
15-
*/
16-
17-
package com.duy.pascal.frontend.utils;
18-
19-
import android.app.Activity;
20-
import android.content.ActivityNotFoundException;
21-
import android.content.Intent;
22-
import android.net.Uri;
23-
24-
/**
25-
* Created by Duy on 10-Jul-17.
26-
*/
27-
28-
public class StoreUtil {
29-
public static void gotoPlayStore(Activity context, String APP_ID) {
30-
Uri uri = Uri.parse("market://details?id=" + APP_ID);
31-
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
32-
// To count with Play market backstack, After pressing back button,
33-
// to taken back to our application, we need to add following flags to intent.
34-
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY |
35-
36-
Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
37-
try {
38-
context.startActivity(goToMarket);
39-
} catch (ActivityNotFoundException e) {
40-
context.startActivity(new Intent(Intent.ACTION_VIEW,
41-
Uri.parse("http://play.google.com/store/apps/details?id=" + APP_ID)));
42-
}
43-
}
44-
45-
public static void gotoPlayStore(Activity context, String APP_ID, int request) {
46-
Uri uri = Uri.parse("market://details?id=" + APP_ID);
47-
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
48-
// To count with Play market backstack, After pressing back button,
49-
// to taken back to our application, we need to add following flags to intent.
50-
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY |
51-
52-
Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
53-
try {
54-
context.startActivityForResult(goToMarket, request);
55-
} catch (ActivityNotFoundException e) {
56-
context.startActivityForResult(new Intent(Intent.ACTION_VIEW,
57-
Uri.parse("http://play.google.com/store/apps/details?id=" + APP_ID)), request);
58-
}
59-
}
60-
61-
public static void shareApp(Activity context, String APP_ID) {
62-
Intent intent = new Intent(Intent.ACTION_SEND);
63-
intent.putExtra(Intent.EXTRA_TEXT, "http://play.google.com/store/apps/details?id=" + APP_ID);
64-
intent.setType("text/plain");
65-
context.startActivity(intent);
66-
}
67-
68-
public static void moreApp(Activity mainActivity) {
69-
Uri uri = Uri.parse("market://search?q=pub:Trần Lê Duy");
70-
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
71-
// To count with Play market backstack, After pressing back button,
72-
// to taken back to our application, we need to add following flags to intent.
73-
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
74-
try {
75-
mainActivity.startActivity(goToMarket);
76-
} catch (ActivityNotFoundException e) {
77-
mainActivity.startActivity(new Intent(Intent.ACTION_VIEW,
78-
Uri.parse("http://play.google.com/store/search?q=pub:Trần Lê Duy")));
79-
}
80-
}
81-
}
1+
/*
2+
* Copyright (c) 2017 Tran Le Duy
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package com.duy.pascal.frontend.utils;
18+
19+
import android.app.Activity;
20+
import android.content.ActivityNotFoundException;
21+
import android.content.Intent;
22+
import android.net.Uri;
23+
24+
/**
25+
* update 1/9/2017
26+
*/
27+
public class StoreUtil {
28+
public static void gotoPlayStore(Activity context, String APP_ID) {
29+
Uri uri = Uri.parse("market://details?id=" + APP_ID);
30+
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
31+
// To count with Play market backstack, After pressing back button,
32+
// to taken back to our application, we need to add following flags to intent.
33+
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
34+
try {
35+
context.startActivity(goToMarket);
36+
} catch (ActivityNotFoundException e) {
37+
context.startActivity(new Intent(Intent.ACTION_VIEW,
38+
Uri.parse("http://play.google.com/store/apps/details?id=" + APP_ID)));
39+
}
40+
}
41+
42+
public static void shareThisApp(Activity context) {
43+
Intent intent = new Intent(Intent.ACTION_SEND);
44+
intent.putExtra(Intent.EXTRA_TEXT, "http://play.google.com/store/apps/details?id=" +
45+
context.getPackageName());
46+
intent.setType("text/plain");
47+
context.startActivity(intent);
48+
}
49+
50+
public static void moreApp(Activity mainActivity) {
51+
String location = "https://play.google.com/store/apps/dev?id=7055567654109499514";
52+
Uri uri = Uri.parse(location);
53+
Intent goToMarket = new Intent(Intent.ACTION_VIEW, uri);
54+
// To count with Play market backstack, After pressing back button,
55+
// to taken back to our application, we need to add following flags to intent.
56+
goToMarket.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
57+
try {
58+
mainActivity.startActivity(goToMarket);
59+
} catch (ActivityNotFoundException e) {
60+
}
61+
}
62+
}

app/src/main/res/values-cs/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@
229229
<string name="custom_theme">Custom theme</string>
230230
<string name="more_theme">Get premium version. Create your custom theme!</string>
231231
<string name="save_and_apply">Save and apply</string>
232+
<string name="auto_insert_bracket">Auto insert bracket</string>
233+
<string name="auto_insert_bracket_summary">Insert ) when type (, ] when type [...</string>
234+
<string name="missing_token_exception">Missing token \"%1$s\"</string>
232235

233236

234237
</resources>

app/src/main/res/values-es/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@
231231
<string name="custom_theme">Custom theme</string>
232232
<string name="more_theme">Get premium version. Create your custom theme!</string>
233233
<string name="save_and_apply">Save and apply</string>
234+
<string name="auto_insert_bracket">Auto insert bracket</string>
235+
<string name="auto_insert_bracket_summary">Insert ) when type (, ] when type [...</string>
236+
<string name="missing_token_exception">Missing token \"%1$s\"</string>
234237

235238

236239
</resources>

app/src/main/res/values-ro/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,5 +239,8 @@
239239
<string name="custom_theme">Custom theme</string>
240240
<string name="more_theme">Get premium version. Create your custom theme!</string>
241241
<string name="save_and_apply">Save and apply</string>
242+
<string name="auto_insert_bracket">Auto insert bracket</string>
243+
<string name="auto_insert_bracket_summary">Insert ) when type (, ] when type [...</string>
244+
<string name="missing_token_exception">Missing token \"%1$s\"</string>
242245

243246
</resources>

app/src/main/res/values-ru/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,4 +232,7 @@
232232
<string name="custom_theme">Custom theme</string>
233233
<string name="more_theme">Get premium version. Create your custom theme!</string>
234234
<string name="save_and_apply">Save and apply</string>
235+
<string name="auto_insert_bracket">Auto insert bracket</string>
236+
<string name="auto_insert_bracket_summary">Insert ) when type (, ] when type [...</string>
237+
<string name="missing_token_exception">Missing token \"%1$s\"</string>
235238
</resources>

app/src/main/res/values-sk/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@
229229
<string name="custom_theme">Custom theme</string>
230230
<string name="more_theme">Get premium version. Create your custom theme!</string>
231231
<string name="save_and_apply">Save and apply</string>
232+
<string name="auto_insert_bracket">Auto insert bracket</string>
233+
<string name="auto_insert_bracket_summary">Insert ) when type (, ] when type [...</string>
234+
<string name="missing_token_exception">Missing token \"%1$s\"</string>
232235

233236

234237
</resources>

app/src/main/res/values-vi/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,4 +228,7 @@
228228
<string name="custom_theme">Custom theme</string>
229229
<string name="more_theme">Get premium version. Create your custom theme!</string>
230230
<string name="save_and_apply">Save and apply</string>
231+
<string name="auto_insert_bracket">Tự động chèn</string>
232+
<string name="auto_insert_bracket_summary">Tự động chèn dấu đóng ngoặc</string>
233+
<string name="missing_token_exception">Có thể thiếu \"%1$s\"</string>
231234
</resources>

app/src/main/res/values-zh-rCN/strings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,5 +232,8 @@
232232
<string name="more_theme">Get premium version. Create your custom theme!</string>
233233
<string name="custom_theme">Custom theme</string>
234234
<string name="save_and_apply">Save and apply</string>
235+
<string name="auto_insert_bracket">Auto insert bracket</string>
236+
<string name="auto_insert_bracket_summary">Insert ) when type (, ] when type [...</string>
237+
<string name="missing_token_exception">Missing token \"%1$s\"</string>
235238
</resources>
236239

app/src/main/res/values/do_not_translate.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,6 @@ procedure routine();
121121
begin
122122
end;
123123
end.]]></string>
124+
125+
<string name="key_auto_insert_bracket" translatable="false">key_auto_insert_bracket</string>
124126
</resources>

app/src/main/res/values/msg_error.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,5 +78,5 @@
7878
Syntax: "if condition then S1 else S2;" \n\n
7979
Where, S1 and S2 are different statements. Please note that the statement S1 is not followed by a "semicolon" (;).</string>
8080
<string name="UnConvertibleTypeException2">The expression or variable \"%1$s\" is of type \"%2$s\" which cannot be convert to the type \"%3$s\" of expression or variable \"%4$s\"</string>
81-
81+
<string name="missing_token_exception">Missing token \"%1$s\"</string>
8282
</resources>

app/src/main/res/values/strings.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@
229229
<string name="donate_nope">I won\'t fall for this scam!</string>
230230
<string name="donate_yes">I love this app. Must donate!</string>
231231

232-
<!--Splash screen-->
233232
<string name="more_font">Get more font</string>
234233
<string name="editor_font">Editor font</string>
235234
<string name="console_font">Console font</string>
@@ -238,8 +237,7 @@
238237
<string name="save_and_apply">Save and apply</string>
239238
<string name="create_new_theme">Create new theme</string>
240239
<string name="more_theme">Get premium version. Create your custom theme!</string>
241-
<string name="key_auto_insert_bracket">key_auto_insert_bracket</string>
242-
<string name="auto_insert_bracket_summary">Insert ) when type (, ] when type [...</string>
240+
<string name="auto_insert_bracket_summary">Insert ) when type (, ] when type […</string>
243241
<string name="auto_insert_bracket">Auto insert bracket</string>
244242
</resources>
245243

0 commit comments

Comments
 (0)