Syntax Fixes

This commit is contained in:
Konloch 2024-09-29 08:51:57 -06:00
parent cd59dd5a20
commit c7dd1be0e6

AI 샘플 코드 생성 중입니다

Loading...
3 changed files with 370 additions and 47 deletions

View File

@ -38,13 +38,49 @@ import java.util.*;
*/
public enum Language
{
ENGLISH("/translations/english.json", "English", "English", "en"), ARABIC("/translations/arabic.json", "عربى", "English", "ar"), CROATIAN("/translations/croatian.json", "hrvatski", "English", "hr"), CZECH("/translations/czech.json", "čeština", "English", "cs"), BULGARIAN("/translations/bulgarian.json", "български", "English", "bg"), DANISH("/translations/danish.json", "dansk", "English", "da"), ESTONIAN("/translations/estonian.json", "Eesti", "English", "et"), FARSI("/translations/farsi.json", "فارسی ", "English", "fa"), FINNISH("/translations/finnish.json", "Suomen Kieli", "English", "fi"), FRENCH("/translations/french.json", "Français", "English", "fr"), GERMAN("/translations/german.json", "Deutsch", "German", "de"), GEORGIAN("/translations/georgian.json", "ქართული ენა", "English", "ka"), GREEK("/translations/greek.json", "ελληνικά", "English", "el"), HAUSA("/translations/hausa.json", "Hausa", "English", "ha"), HEBREW("/translations/hebrew.json", "עִבְרִית\u200E", "English", "iw", "he"), //HINDI("/translations/hindi.json", "हिंदी", "English", "hi"),
//BENGALI("/translations/bengali.json", "বাংলা", "English", "bn"),
HUNGARIAN("/translations/hungarian.json", "Magyar Nyelv", "English", "hu"), INDONESIAN("/translations/indonesian.json", "bahasa Indonesia", "English", "id"), ITALIAN("/translations/italian.json", "Italiano", "English", "it"), JAPANESE("/translations/japanese.json", "日本語", "English", "ja"), LATIVAN("/translations/lativan.json", "Lativan", "English", "lv"), LITHUANIAN("/translations/lithuanian.json", "Lietuvių", "English", "lt"), //JAVANESE("/translations/javanese.json", "ꦧꦱꦗꦮ", "English", "jw", "jv"),
//KOREAN("/translations/korean.json", "Korean", "English", "ko"),
MALAY("/translations/malay.json", "Bahasa Melayu", "English", "ms"), MANDARIN("/translations/mandarin.json", "普通话", "Mandarin", "zh-CN", "zh_cn", "zh"), NEDERLANDS("/translations/nederlands.json", "Nederlands", "English", "nl"), //dutch
NORWEGIAN("/translations/norwegian.json", "Norsk", "English", "no"), POLISH("/translations/polish.json", "Polski", "English", "pl"), PORTUGUESE("/translations/portuguese.json", "Português", "English", "pt"), ROMANIAN("/translations/romanian.json", "Română", "English", "ro"), RUSSIAN("/translations/russian.json", "русский", "English", "ru"), SLOVAK("/translations/slovak.json", "Slovensky", "English", "sk"), SLOVENIAN("/translations/slovenian.json", "Slovenščina", "English", "sl"), SPANISH("/translations/spanish.json", "Español", "English", "es"), SERBIAN("/translations/serbian.json", "српски језик", "English", "sr"), SWAHILI("/translations/swahili.json", "Kiswahili", "English", "sw"), SWEDISH("/translations/swedish.json", "svenska", "English", "sv"), //THAI("/translations/thai.json", "ภาษาไทย", "English", "th"),
TURKISH("/translations/turkish.json", "Türkçe", "English", "tr"), UKRAINIAN("/translations/ukrainian.json", "украї́нська мо́ва", "English", "uk"), VIETNAMESE("/translations/vietnamese.json", "Tiếng Việt", "English", "vi"),
ENGLISH("/translations/english.json", "English", "English", "en"),
ARABIC("/translations/arabic.json", "عربى", "English", "ar"),
CROATIAN("/translations/croatian.json", "hrvatski", "English", "hr"),
CZECH("/translations/czech.json", "čeština", "English", "cs"),
BULGARIAN("/translations/bulgarian.json", "български", "English", "bg"),
DANISH("/translations/danish.json", "dansk", "English", "da"),
ESTONIAN("/translations/estonian.json", "Eesti", "English", "et"),
FARSI("/translations/farsi.json", "فارسی ", "English", "fa"),
FINNISH("/translations/finnish.json", "Suomen Kieli", "English", "fi"),
FRENCH("/translations/french.json", "Français", "English", "fr"),
GERMAN("/translations/german.json", "Deutsch", "German", "de"),
GEORGIAN("/translations/georgian.json", "ქართული ენა", "English", "ka"),
GREEK("/translations/greek.json", "ελληνικά", "English", "el"),
HAUSA("/translations/hausa.json", "Hausa", "English", "ha"),
HEBREW("/translations/hebrew.json", "עִבְרִית\u200E", "English", "iw", "he"),
//HINDI("/translations/hindi.json", "हिंदी", "English", "hi"),
//BENGALI("/translations/bengali.json", "বাংলা", "English", "bn"),
HUNGARIAN("/translations/hungarian.json", "Magyar Nyelv", "English", "hu"),
INDONESIAN("/translations/indonesian.json", "bahasa Indonesia", "English", "id"),
ITALIAN("/translations/italian.json", "Italiano", "English", "it"),
JAPANESE("/translations/japanese.json", "日本語", "English", "ja"),
LATIVAN("/translations/lativan.json", "Lativan", "English", "lv"),
LITHUANIAN("/translations/lithuanian.json", "Lietuvių", "English", "lt"),
//JAVANESE("/translations/javanese.json", "ꦧꦱꦗꦮ", "English", "jw", "jv"),
//KOREAN("/translations/korean.json", "Korean", "English", "ko"),
MALAY("/translations/malay.json", "Bahasa Melayu", "English", "ms"),
MANDARIN("/translations/mandarin.json", "普通话", "Mandarin", "zh-CN", "zh_cn", "zh"),
NEDERLANDS("/translations/nederlands.json", "Nederlands", "English", "nl"), //dutch
NORWEGIAN("/translations/norwegian.json", "Norsk", "English", "no"),
POLISH("/translations/polish.json", "Polski", "English", "pl"),
PORTUGUESE("/translations/portuguese.json", "Português", "English", "pt"),
ROMANIAN("/translations/romanian.json", "Română", "English", "ro"),
RUSSIAN("/translations/russian.json", "русский", "English", "ru"),
SLOVAK("/translations/slovak.json", "Slovensky", "English", "sk"),
SLOVENIAN("/translations/slovenian.json", "Slovenščina", "English", "sl"),
SPANISH("/translations/spanish.json", "Español", "English", "es"),
SERBIAN("/translations/serbian.json", "српски језик", "English", "sr"),
SWAHILI("/translations/swahili.json", "Kiswahili", "English", "sw"),
SWEDISH("/translations/swedish.json", "svenska", "English", "sv"),
//THAI("/translations/thai.json", "ภาษาไทย", "English", "th"),
TURKISH("/translations/turkish.json", "Türkçe", "English", "tr"),
UKRAINIAN("/translations/ukrainian.json", "украї́нська мо́ва", "English", "uk"),
VIETNAMESE("/translations/vietnamese.json", "Tiếng Việt", "English", "vi"),
;
private static final Map<String, Language> languageCodeLookup;
@ -52,8 +88,9 @@ TURKISH("/translations/turkish.json", "Türkçe", "English", "tr"), UKRAINIAN("/
static
{
languageCodeLookup = new LinkedHashMap<>();
for (Language l : values())
l.languageCode.forEach((langCode) -> languageCodeLookup.put(langCode, l));
for(Language l : values())
l.languageCode.forEach((langCode)->
languageCodeLookup.put(langCode, l));
}
private final String resourcePath;
@ -76,12 +113,12 @@ TURKISH("/translations/turkish.json", "Türkçe", "English", "tr"), UKRAINIAN("/
Map<String, String> translationMap = getTranslation();
for (TranslatedComponents translatedComponents : TranslatedComponents.values())
for(TranslatedComponents translatedComponents : TranslatedComponents.values())
{
TranslatedComponentReference text = translatedComponents.getTranslatedComponentReference();
//skip translating if the language config is missing the translation key
if (!translationMap.containsKey(text.key))
if(!translationMap.containsKey(text.key))
{
BCV.logE(true, resourcePath + " -> " + text.key + " - Missing Translation Key");
continue;
@ -91,18 +128,14 @@ TURKISH("/translations/turkish.json", "Türkçe", "English", "tr"), UKRAINIAN("/
text.value = translationMap.get(text.key);
//translate constant strings
try
{
try {
TranslatedStrings str = TranslatedStrings.valueOf(text.key);
str.setText(text.value);
}
catch (IllegalArgumentException ignored)
{
}
} catch (IllegalArgumentException ignored) { }
//check if translation key has been assigned to a component,
//on fail print an error alerting the devs
if (translatedComponents.getTranslatedComponentReference().runOnUpdate.isEmpty())
if(translatedComponents.getTranslatedComponentReference().runOnUpdate.isEmpty())
//&& TranslatedStrings.nameSet.contains(translation.name()))
{
BCV.logE(true, "TranslatedComponents:" + translatedComponents.name() + " is missing component attachment, skipping...");
@ -116,9 +149,11 @@ TURKISH("/translations/turkish.json", "Türkçe", "English", "tr"), UKRAINIAN("/
public Map<String, String> getTranslation() throws IOException
{
if (translationMap == null)
if(translationMap == null)
{
translationMap = BytecodeViewer.gson.fromJson(Resource.loadResourceAsString(resourcePath), new TypeToken<HashMap<String, String>>() {}.getType());
translationMap = BytecodeViewer.gson.fromJson(
Resource.loadResourceAsString(resourcePath),
new TypeToken<HashMap<String, String>>() {}.getType());
}
return translationMap;
@ -133,17 +168,19 @@ TURKISH("/translations/turkish.json", "Türkçe", "English", "tr"), UKRAINIAN("/
// 4) add the translation key to the rest of the translation files
public void printMissingLanguageKeys() throws IOException
{
if (this != ENGLISH)
if(this != ENGLISH)
return;
LinkedMap<String, String> translationMap = BytecodeViewer.gson.fromJson(Resource.loadResourceAsString(resourcePath), new TypeToken<LinkedMap<String, String>>() {}.getType());
LinkedMap<String, String> translationMap = BytecodeViewer.gson.fromJson(
Resource.loadResourceAsString(resourcePath),
new TypeToken<LinkedMap<String, String>>(){}.getType());
Set<String> existingKeys = new HashSet<>();
for (TranslatedComponents t : TranslatedComponents.values())
for(TranslatedComponents t : TranslatedComponents.values())
existingKeys.add(t.name());
for (String key : translationMap.keySet())
if (!existingKeys.contains(key))
for(String key : translationMap.keySet())
if(!existingKeys.contains(key))
BCV.logE(true, key + ",");
}
@ -164,7 +201,7 @@ TURKISH("/translations/turkish.json", "Türkçe", "English", "tr"), UKRAINIAN("/
public String getHTMLPath(String identifier)
{
return "translations/html/" + identifier + "." + htmlIdentifier + ".html";
return "translations/html/" + identifier + "." + htmlIdentifier + ".html";
}
public static Map<String, Language> getLanguageCodeLookup()

View File

@ -30,32 +30,233 @@ package the.bytecode.club.bytecodeviewer.translation;
public enum TranslatedComponents
{
FILE, ADD, NEW_WORKSPACE, RELOAD_RESOURCES, RUN, OPEN, COMPILE, SAVE, SAVE_AS, SAVE_AS_RUNNABLE_JAR, SAVE_AS_ZIP, SAVE_AS_DEX, SAVE_AS_APK, DECOMPILE_SAVE_OPENED_CLASSES, DECOMPILE_SAVE_ALL_CLASSES, RECENT_FILES, ABOUT, EXIT,
FILE,
ADD,
NEW_WORKSPACE,
RELOAD_RESOURCES,
RUN,
OPEN,
COMPILE,
SAVE,
SAVE_AS,
SAVE_AS_RUNNABLE_JAR,
SAVE_AS_ZIP,
SAVE_AS_DEX,
SAVE_AS_APK,
DECOMPILE_SAVE_OPENED_CLASSES,
DECOMPILE_SAVE_ALL_CLASSES,
RECENT_FILES,
ABOUT,
EXIT,
VIEW, VISUAL_SETTINGS, LANGUAGE, WINDOW_THEME, SYSTEM_THEME, DARK_THEME, LIGHT_THEME, ONE_DARK_THEME, SOLARIZED_DARK_THEME, SOLARIZED_LIGHT_THEME, HIGH_CONTRAST_DARK_THEME, HIGH_CONTRAST_LIGHT_THEME, DARK, ONE_DARK, SOLARIZED_DARK, SOLARIZED_LIGHT, HIGH_CONTRAST_DARK, HIGH_CONTRAST_LIGHT,
VIEW,
VISUAL_SETTINGS,
LANGUAGE,
WINDOW_THEME,
SYSTEM_THEME,
DARK_THEME,
LIGHT_THEME,
ONE_DARK_THEME,
SOLARIZED_DARK_THEME,
SOLARIZED_LIGHT_THEME,
HIGH_CONTRAST_DARK_THEME,
HIGH_CONTRAST_LIGHT_THEME,
DARK,
ONE_DARK,
SOLARIZED_DARK,
SOLARIZED_LIGHT,
HIGH_CONTRAST_DARK,
HIGH_CONTRAST_LIGHT,
TEXT_AREA_THEME, DEFAULT_RECOMMENDED_LIGHT, THEME_MATCH, DARK_ALT, DEFAULT_ALT, ECLIPSE, INTELLIJ, VISUAL_STUDIO, DRUID_DARK, MONOKAI_DARK,
TEXT_AREA_THEME,
DEFAULT_RECOMMENDED_LIGHT,
THEME_MATCH,
DARK_ALT,
DEFAULT_ALT,
ECLIPSE,
INTELLIJ,
VISUAL_STUDIO,
DRUID_DARK,
MONOKAI_DARK,
FONT_SIZE, SHOW_TAB_FILE_IN_TAB_TITLE, SIMPLIFY_NAME_IN_TAB_TITLE, SYNCHRONIZED_VIEWING, SHOW_CLASS_METHODS,
FONT_SIZE,
SHOW_TAB_FILE_IN_TAB_TITLE,
SIMPLIFY_NAME_IN_TAB_TITLE,
SYNCHRONIZED_VIEWING,
SHOW_CLASS_METHODS,
PANE_1, PANE_2, PANE_3, NONE, EDITABLE, JAVA, BYTECODE, HEXCODE, ASM_TEXTIFY, ASMIFIER,
PANE_1,
PANE_2,
PANE_3,
NONE,
EDITABLE,
JAVA,
BYTECODE,
HEXCODE,
ASM_TEXTIFY,
ASMIFIER,
SETTINGS, COMPILE_ON_SAVE, COMPILE_ON_REFRESH, REFRESH_ON_VIEW_CHANGE, DECODE_APK_RESOURCES, APK_CONVERSION, APK_CONVERSION_DECODING, UPDATE_CHECK, DELETE_UNKNOWN_LIBS, FORCE_PURE_ASCII_AS_TEXT, SET_PYTHON_27_EXECUTABLE, SET_PYTHON_30_EXECUTABLE, SET_JRE_RT_LIBRARY, SET_OPTIONAL_LIBRARY_FOLDER, SET_JAVAC_EXECUTABLE, BYTECODE_DECOMPILER, DEBUG_HELPERS, APPEND_BRACKETS_TO_LABEL,
SETTINGS,
COMPILE_ON_SAVE,
COMPILE_ON_REFRESH,
REFRESH_ON_VIEW_CHANGE,
DECODE_APK_RESOURCES,
APK_CONVERSION,
APK_CONVERSION_DECODING,
UPDATE_CHECK,
DELETE_UNKNOWN_LIBS,
FORCE_PURE_ASCII_AS_TEXT,
SET_PYTHON_27_EXECUTABLE,
SET_PYTHON_30_EXECUTABLE,
SET_JRE_RT_LIBRARY,
SET_OPTIONAL_LIBRARY_FOLDER,
SET_JAVAC_EXECUTABLE,
BYTECODE_DECOMPILER,
DEBUG_HELPERS,
APPEND_BRACKETS_TO_LABEL,
PLUGINS, OPEN_PLUGIN, RECENT_PLUGINS, NEW_JAVA_PLUGIN, NEW_JAVASCRIPT_PLUGIN, CODE_SEQUENCE_DIAGRAM, MALICIOUS_CODE_SCANNER, SHOW_MAIN_METHODS, SHOW_ALL_STRINGS, REPLACE_STRINGS, STACK_FRAMES_REMOVER, ZKM_STRING_DECRYPTER, ALLATORI_STRING_DECRYPTER, ZSTRINGARRAY_DECRYPTER,
PLUGINS,
OPEN_PLUGIN,
RECENT_PLUGINS,
NEW_JAVA_PLUGIN,
NEW_JAVASCRIPT_PLUGIN,
CODE_SEQUENCE_DIAGRAM,
MALICIOUS_CODE_SCANNER,
SHOW_MAIN_METHODS,
SHOW_ALL_STRINGS,
REPLACE_STRINGS,
STACK_FRAMES_REMOVER,
ZKM_STRING_DECRYPTER,
ALLATORI_STRING_DECRYPTER,
ZSTRINGARRAY_DECRYPTER,
HIDE_BRIDGE_METHODS, HIDE_SYNTHETIC_CLASS_MEMBERS, DECOMPILE_INNER_CLASSES, COLLAPSE_14_CLASS_REFERENCES, DECOMPILE_ASSERTIONS, HIDE_EMPTY_SUPER_INVOCATION, HIDE_EMPTY_DEFAULT_CONSTRUCTOR, DECOMPILE_GENERIC_SIGNATURES, ASSUME_RETURN_NOT_THROWING_EXCEPTIONS, DECOMPILE_ENUMERATIONS, REMOVE_GETCLASS_INVOCATION, INTERPRET_INT_1_AS_BOOLEAN_TRUE, ALLOW_FOR_NOT_SET_SYNTHETIC_ATTRIBUTE, CONSIDER_NAMELESS_TYPES_AS_JAVALANGOBJECT, RECONSTRUCT_VARIABLE_NAMES_FROM_DEBUG_INFO, REMOVE_EMPTY_EXCEPTION_RANGES, DEINLINE_FINALLY_STRUCTURES, ALLOW_ONLY_ASCII_CHARACTERS_IN_STRINGS, RENAME_AMBIGUOUS_CLASSES_AND_CLASS_ELEMENTS,
HIDE_BRIDGE_METHODS,
HIDE_SYNTHETIC_CLASS_MEMBERS,
DECOMPILE_INNER_CLASSES,
COLLAPSE_14_CLASS_REFERENCES,
DECOMPILE_ASSERTIONS,
HIDE_EMPTY_SUPER_INVOCATION,
HIDE_EMPTY_DEFAULT_CONSTRUCTOR,
DECOMPILE_GENERIC_SIGNATURES,
ASSUME_RETURN_NOT_THROWING_EXCEPTIONS,
DECOMPILE_ENUMERATIONS,
REMOVE_GETCLASS_INVOCATION,
INTERPRET_INT_1_AS_BOOLEAN_TRUE,
ALLOW_FOR_NOT_SET_SYNTHETIC_ATTRIBUTE,
CONSIDER_NAMELESS_TYPES_AS_JAVALANGOBJECT,
RECONSTRUCT_VARIABLE_NAMES_FROM_DEBUG_INFO,
REMOVE_EMPTY_EXCEPTION_RANGES,
DEINLINE_FINALLY_STRUCTURES,
ALLOW_ONLY_ASCII_CHARACTERS_IN_STRINGS,
RENAME_AMBIGUOUS_CLASSES_AND_CLASS_ELEMENTS,
DECODE_ENUM_SWITCH, SUGARENUMS, DECODE_STRING_SWITCH, ARRAYITER, COLLECTIONITER, INNER_CLASSES, REMOVE_BOILER_PLATE, REMOVE_INNER_CLASS_SYNTHETICS, DECODE_LAMBDAS, LIFT__CONSTRUCTOR_INIT, REMOVE_DEAD_METHODS, REMOVE_BAD_GENERICS, SUGAR_ASSERTS, SUGAR_BOXING, SHOW_VERSION, DECODE_FINALLY, TIDY_MONITORS, LENIENT, DUMP_CLASSPATH, COMMENTS, FORCE_TOP_SORT, FORCE_TOP_SORT_AGGRESS, FORCE_EXCEPTION_PRUNE, STRING_BUFFER, STRING_BUILDER, SILENT, RECOVER,
DECODE_ENUM_SWITCH,
SUGARENUMS,
DECODE_STRING_SWITCH,
ARRAYITER,
COLLECTIONITER,
INNER_CLASSES,
REMOVE_BOILER_PLATE,
REMOVE_INNER_CLASS_SYNTHETICS,
DECODE_LAMBDAS,
LIFT__CONSTRUCTOR_INIT,
REMOVE_DEAD_METHODS,
REMOVE_BAD_GENERICS,
SUGAR_ASSERTS,
SUGAR_BOXING,
SHOW_VERSION,
DECODE_FINALLY,
TIDY_MONITORS,
LENIENT,
DUMP_CLASSPATH,
COMMENTS,
FORCE_TOP_SORT,
FORCE_TOP_SORT_AGGRESS,
FORCE_EXCEPTION_PRUNE,
STRING_BUFFER,
STRING_BUILDER,
SILENT,
RECOVER,
OVERRIDE, SHOW_INFERRABLE, AEXAGG, FORCE_COND_PROPAGATE, HIDE_UTF, HIDE_LONG_STRINGS, COMMENT_MONITORS, ALLOW_CORRECTING, LABELLED_BLOCKS, J14CLASSOBJ, HIDE_LANG_IMPORTS, RECOVER_TYPE_CLASH, RECOVER_TYPE__HINTS, FORCE_RETURNING_IFS, FOR_LOOP_AGG_CAPTURE,
OVERRIDE,
SHOW_INFERRABLE,
AEXAGG,
FORCE_COND_PROPAGATE,
HIDE_UTF,
HIDE_LONG_STRINGS,
COMMENT_MONITORS,
ALLOW_CORRECTING,
LABELLED_BLOCKS,
J14CLASSOBJ,
HIDE_LANG_IMPORTS,
RECOVER_TYPE_CLASH,
RECOVER_TYPE__HINTS,
FORCE_RETURNING_IFS,
FOR_LOOP_AGG_CAPTURE,
ALWAYS_GENERATE_EXCEPTION_VARIABLE_FOR_CATCH_BLOCKS, EXCLUDE_NESTED_TYPES, SHOW_DEBUG_LINE_NUMBERS, INCLUDE_LINE_NUMBERS_IN_BYTECODE, INCLUDE_ERROR_DIAGNOSTICS, SHOW_SYNTHETIC_MEMBERS, SIMPLIFY_MEMBER_REFERENCES, MERGE_VARIABLES, FORCE_EXPLICIT_TYPE_ARGUMENTS, FORCE_EXPLICIT_IMPORTS, FLATTEN_SWITCH_BLOCKS, RETAIN_POINTLESS_SWITCHES, RETAIN_REDUNDANT_CASTS, UNICODE_OUTPUT_ENABLED,
ALWAYS_GENERATE_EXCEPTION_VARIABLE_FOR_CATCH_BLOCKS,
EXCLUDE_NESTED_TYPES,
SHOW_DEBUG_LINE_NUMBERS,
INCLUDE_LINE_NUMBERS_IN_BYTECODE,
INCLUDE_ERROR_DIAGNOSTICS,
SHOW_SYNTHETIC_MEMBERS,
SIMPLIFY_MEMBER_REFERENCES,
MERGE_VARIABLES,
FORCE_EXPLICIT_TYPE_ARGUMENTS,
FORCE_EXPLICIT_IMPORTS,
FLATTEN_SWITCH_BLOCKS,
RETAIN_POINTLESS_SWITCHES,
RETAIN_REDUNDANT_CASTS,
UNICODE_OUTPUT_ENABLED,
VIEW_ANDROID_PERMISSIONS, VIEW_MANIFEST, CHANGE_CLASSFILE_VERSIONS,
VIEW_ANDROID_PERMISSIONS,
VIEW_MANIFEST,
CHANGE_CLASSFILE_VERSIONS,
DEX_TO_JAR, ENJARIFY, PROCYON_SETTINGS, CFR_SETTINGS, FERNFLOWER_SETTINGS, PROCYON, CFR, FERNFLOWER, KRAKATAU, JDGUI, JADX, SMALI_DEX, SMALI, DISASSEMBLER, ERROR, SUGGESTED_FIX_DECOMPILER_ERROR, SUGGESTED_FIX_COMPILER_ERROR, PROCYON_DECOMPILER, CFR_DECOMPILER, FERNFLOWER_DECOMPILER, JADX_DECOMPILER, JD_DECOMPILER, BYTECODE_DISASSEMBLER, FILES, QUICK_FILE_SEARCH_NO_FILE_EXTENSION, WORK_SPACE, EXACT, DRAG_CLASS_JAR, SEARCH, SEARCH_STRING, SEARCH_FROM, SEARCH_REGEX, OWNER, NAME, DESC, RESULTS, REFRESH, MIN_SDK_VERSION, ANNOTATION_NAME, MATCH_CASE, EXACT_PATH, PRINT_LINE_NUMBERS, AUTO_OPEN,
DEX_TO_JAR,
ENJARIFY,
PROCYON_SETTINGS,
CFR_SETTINGS,
FERNFLOWER_SETTINGS,
PROCYON,
CFR,
FERNFLOWER,
KRAKATAU,
JDGUI,
JADX,
SMALI_DEX,
SMALI,
DISASSEMBLER,
ERROR,
SUGGESTED_FIX_DECOMPILER_ERROR,
SUGGESTED_FIX_COMPILER_ERROR,
PROCYON_DECOMPILER,
CFR_DECOMPILER,
FERNFLOWER_DECOMPILER,
JADX_DECOMPILER,
JD_DECOMPILER,
BYTECODE_DISASSEMBLER,
FILES,
QUICK_FILE_SEARCH_NO_FILE_EXTENSION,
WORK_SPACE,
EXACT,
DRAG_CLASS_JAR,
SEARCH,
SEARCH_STRING,
SEARCH_FROM,
SEARCH_REGEX,
OWNER,
NAME,
DESC,
RESULTS,
REFRESH,
MIN_SDK_VERSION,
ANNOTATION_NAME,
MATCH_CASE,
EXACT_PATH,
PRINT_LINE_NUMBERS,
AUTO_OPEN,
;
private final TranslatedComponentReference componentReference;

View File

@ -35,22 +35,101 @@ import java.util.Set;
public enum TranslatedStrings
{
PRODUCT("BCV"), PRODUCTNAME("BytecodeViewer"), PRODUCT_NAME("Bytecode Viewer"), PRODUCT_H_NAME("Bytecode-Viewer"), WEBSITE("https://bytecodeviewer.com"), TBC("https://the.bytecode.club"),
PRODUCT("BCV"),
PRODUCTNAME("BytecodeViewer"),
PRODUCT_NAME("Bytecode Viewer"),
PRODUCT_H_NAME("Bytecode-Viewer"),
WEBSITE("https://bytecodeviewer.com"),
TBC("https://the.bytecode.club"),
EDITABLE, JAVA, PROCYON, CFR, FERNFLOWER, KRAKATAU, JDGUI, JADX, SMALI, SMALI_DEX, HEXCODE, BYTECODE, ASM_TEXTIFY, ASMIFIER, ERROR, DISASSEMBLER, RESULTS, SEARCH,
EDITABLE,
JAVA,
PROCYON,
CFR,
FERNFLOWER,
KRAKATAU,
JDGUI,
JADX,
SMALI,
SMALI_DEX,
HEXCODE,
BYTECODE,
ASM_TEXTIFY,
ASMIFIER,
ERROR,
DISASSEMBLER,
RESULTS,
SEARCH,
OPEN_UNSTYLED, QUICK_OPEN, DELETE, NEW, EXPAND, COLLAPSE, RELOAD_RESOURCES_TITLE, RELOAD_RESOURCES_CONFIRM, SELECT_FILE_TITLE, SELECT_FILE_DESCRIPTION, SELECT_EXTERNAL_PLUGIN_TITLE, SELECT_EXTERNAL_PLUGIN_DESCRIPTION, FOREIGN_LIBRARY_WARNING, RESET_TITLE, RESET_CONFIRM, EXIT_TITLE, EXIT_CONFIRM, ABOUT_TITLE, PLUGIN_CONSOLE_TITLE, CLOSE_ALL_BUT_THIS, CLOSE_TAB, PLEASE_SEND_THIS_ERROR_LOG_TO, PLEASE_SEND_RESOURCES, ONE_PLUGIN_AT_A_TIME, ILLEGAL_ACCESS_ERROR,
OPEN_UNSTYLED,
QUICK_OPEN,
DELETE,
NEW,
EXPAND,
COLLAPSE,
RELOAD_RESOURCES_TITLE,
RELOAD_RESOURCES_CONFIRM,
SELECT_FILE_TITLE,
SELECT_FILE_DESCRIPTION,
SELECT_EXTERNAL_PLUGIN_TITLE,
SELECT_EXTERNAL_PLUGIN_DESCRIPTION,
FOREIGN_LIBRARY_WARNING,
RESET_TITLE,
RESET_CONFIRM,
EXIT_TITLE,
EXIT_CONFIRM,
ABOUT_TITLE,
PLUGIN_CONSOLE_TITLE,
CLOSE_ALL_BUT_THIS,
CLOSE_TAB,
PLEASE_SEND_THIS_ERROR_LOG_TO,
PLEASE_SEND_RESOURCES,
ONE_PLUGIN_AT_A_TIME,
ILLEGAL_ACCESS_ERROR,
YES, NO, ERROR2, PROCESS2, EXIT_VALUE_IS, ERROR_COMPILING_CLASS, COMPILER_TIP, JAVA_COMPILE_FAILED, SELECT_LIBRARY_FOLDER, SELECT_JAVA_RT, SELECT_JAVA, SELECT_JAVAC, SELECT_JAVA_TOOLS, SELECT_PYTHON_2, SELECT_PYTHON_3, PYTHON_2_EXECUTABLE, PYTHON_3_EXECUTABLE, YOU_NEED_TO_SET_YOUR_PYTHON_2_PATH, YOU_NEED_TO_SET_YOUR_PYTHON_3_PATH, YOU_NEED_TO_SET_YOUR_JAVA_RT_PATH_A, YOU_NEED_TO_SET_YOUR_JAVA_RT_PATH_B, JAVA_EXECUTABLE, JAVAC_EXECUTABLE, JAVA_TOOLS_JAR, JAVA_RT_JAR, OPTIONAL_LIBRARY_FOLDER, QUICK_FILE_SEARCH_NO_FILE_EXTENSION, SUGGESTED_FIX_DECOMPILER_ERROR, SUGGESTED_FIX_COMPILER_ERROR, FIRST_OPEN_A_RESOURCE, FIRST_OPEN_A_CLASS, FIRST_VIEW_A_CLASS, SUGGESTED_FIX_NO_DECOMPILER_WARNING, DRAG_CLASS_JAR,
YES,
NO,
ERROR2,
PROCESS2,
EXIT_VALUE_IS,
ERROR_COMPILING_CLASS,
COMPILER_TIP,
JAVA_COMPILE_FAILED,
SELECT_LIBRARY_FOLDER,
SELECT_JAVA_RT,
SELECT_JAVA,
SELECT_JAVAC,
SELECT_JAVA_TOOLS,
SELECT_PYTHON_2,
SELECT_PYTHON_3,
PYTHON_2_EXECUTABLE,
PYTHON_3_EXECUTABLE,
YOU_NEED_TO_SET_YOUR_PYTHON_2_PATH,
YOU_NEED_TO_SET_YOUR_PYTHON_3_PATH,
YOU_NEED_TO_SET_YOUR_JAVA_RT_PATH_A,
YOU_NEED_TO_SET_YOUR_JAVA_RT_PATH_B,
JAVA_EXECUTABLE,
JAVAC_EXECUTABLE,
JAVA_TOOLS_JAR,
JAVA_RT_JAR,
OPTIONAL_LIBRARY_FOLDER,
QUICK_FILE_SEARCH_NO_FILE_EXTENSION,
SUGGESTED_FIX_DECOMPILER_ERROR,
SUGGESTED_FIX_COMPILER_ERROR,
FIRST_OPEN_A_RESOURCE,
FIRST_OPEN_A_CLASS,
FIRST_VIEW_A_CLASS,
SUGGESTED_FIX_NO_DECOMPILER_WARNING,
DRAG_CLASS_JAR,
;
public static final Set<String> nameSet = new HashSet<>();
static
{
for (TranslatedStrings s : values())
for(TranslatedStrings s : values())
nameSet.add(s.name());
}
@ -77,14 +156,20 @@ public enum TranslatedStrings
public void setText(String text)
{
if (text == null)
if(text == null)
{
BCV.logE(true, "TranslatedStrings:" + name() + " - Missing Translation");
BCV.logE(true, "TranslatedStrings:"+name() + " - Missing Translation");
text = TEXT_ERROR;
}
//TODO this should be tokenized against the TranslatedStrings enum
text = text.replace("{PRODUCTNAME}", PRODUCTNAME.toString()).replace("{PRODUCT_NAME}", PRODUCT_NAME.toString()).replace("{PRODUCT-NAME}", PRODUCT_H_NAME.toString()).replace("{PRODUCT}", PRODUCT.toString()).replace("{TBC}", TBC.toString()).replace("{WEBSITE}", WEBSITE.toString());
text = text.replace("{PRODUCTNAME}", PRODUCTNAME.toString())
.replace("{PRODUCT_NAME}", PRODUCT_NAME.toString())
.replace("{PRODUCT-NAME}", PRODUCT_H_NAME.toString())
.replace("{PRODUCT}", PRODUCT.toString())
.replace("{TBC}", TBC.toString())
.replace("{WEBSITE}", WEBSITE.toString())
;
this.text = text;
}