eric6/Plugins/CheckerPlugins/CodeStyleChecker/translations.py

changeset 7609
d5aff4fd0ef8
parent 7360
9190402e4505
child 7610
df7025fe26a3
equal deleted inserted replaced
7606:a3a4760b59ec 7609:d5aff4fd0ef8
852 "{0}: {1}"), 852 "{0}: {1}"),
853 853
854 ################################################################## 854 ##################################################################
855 ## CodeStyleFixer messages 855 ## CodeStyleFixer messages
856 ################################################################## 856 ##################################################################
857 "FD111": QCoreApplication.translate( 857
858 "FIXD111": QCoreApplication.translate(
858 'CodeStyleFixer', 859 'CodeStyleFixer',
859 "Triple single quotes converted to triple double quotes."), 860 "Triple single quotes converted to triple double quotes."),
860 'FD112': QCoreApplication.translate( 861 'FIXD112': QCoreApplication.translate(
861 'CodeStyleFixer', 862 'CodeStyleFixer',
862 'Introductory quotes corrected to be {0}"""'), 863 'Introductory quotes corrected to be {0}"""'),
863 "FD121": QCoreApplication.translate( 864 "FIXD121": QCoreApplication.translate(
864 'CodeStyleFixer', 865 'CodeStyleFixer',
865 "Single line docstring put on one line."), 866 "Single line docstring put on one line."),
866 "FD131": QCoreApplication.translate( 867 "FIXD131": QCoreApplication.translate(
867 'CodeStyleFixer', 868 'CodeStyleFixer',
868 "Period added to summary line."), 869 "Period added to summary line."),
869 "FD141": QCoreApplication.translate( 870 "FIXD141": QCoreApplication.translate(
870 'CodeStyleFixer', 871 'CodeStyleFixer',
871 "Blank line before function/method docstring removed."), 872 "Blank line before function/method docstring removed."),
872 "FD142": QCoreApplication.translate( 873 "FIXD142": QCoreApplication.translate(
873 'CodeStyleFixer', 874 'CodeStyleFixer',
874 "Blank line inserted before class docstring."), 875 "Blank line inserted before class docstring."),
875 "FD143": QCoreApplication.translate( 876 "FIXD143": QCoreApplication.translate(
876 'CodeStyleFixer', 877 'CodeStyleFixer',
877 "Blank line inserted after class docstring."), 878 "Blank line inserted after class docstring."),
878 "FD144": QCoreApplication.translate( 879 "FIXD144": QCoreApplication.translate(
879 'CodeStyleFixer', 880 'CodeStyleFixer',
880 "Blank line inserted after docstring summary."), 881 "Blank line inserted after docstring summary."),
881 "FD145": QCoreApplication.translate( 882 "FIXD145": QCoreApplication.translate(
882 'CodeStyleFixer', 883 'CodeStyleFixer',
883 "Blank line inserted after last paragraph of docstring."), 884 "Blank line inserted after last paragraph of docstring."),
884 "FD221": QCoreApplication.translate( 885 "FIXD221": QCoreApplication.translate(
885 'CodeStyleFixer', 886 'CodeStyleFixer',
886 "Leading quotes put on separate line."), 887 "Leading quotes put on separate line."),
887 "FD222": QCoreApplication.translate( 888 "FIXD222": QCoreApplication.translate(
888 'CodeStyleFixer', 889 'CodeStyleFixer',
889 "Trailing quotes put on separate line."), 890 "Trailing quotes put on separate line."),
890 "FD242": QCoreApplication.translate( 891 "FIXD242": QCoreApplication.translate(
891 'CodeStyleFixer', 892 'CodeStyleFixer',
892 "Blank line before class docstring removed."), 893 "Blank line before class docstring removed."),
893 "FD244": QCoreApplication.translate( 894 "FIXD244": QCoreApplication.translate(
894 'CodeStyleFixer', 895 'CodeStyleFixer',
895 "Blank line before function/method docstring removed."), 896 "Blank line before function/method docstring removed."),
896 "FD243": QCoreApplication.translate( 897 "FIXD243": QCoreApplication.translate(
897 'CodeStyleFixer', 898 'CodeStyleFixer',
898 "Blank line after class docstring removed."), 899 "Blank line after class docstring removed."),
899 "FD245": QCoreApplication.translate( 900 "FIXD245": QCoreApplication.translate(
900 'CodeStyleFixer', 901 'CodeStyleFixer',
901 "Blank line after function/method docstring removed."), 902 "Blank line after function/method docstring removed."),
902 "FD247": QCoreApplication.translate( 903 "FIXD247": QCoreApplication.translate(
903 'CodeStyleFixer', 904 'CodeStyleFixer',
904 "Blank line after last paragraph removed."), 905 "Blank line after last paragraph removed."),
905 "FE101": QCoreApplication.translate( 906 "FIXE101": QCoreApplication.translate(
906 'CodeStyleFixer', 907 'CodeStyleFixer',
907 "Tab converted to 4 spaces."), 908 "Tab converted to 4 spaces."),
908 "FE111": QCoreApplication.translate( 909 "FIXE111": QCoreApplication.translate(
909 'CodeStyleFixer', 910 'CodeStyleFixer',
910 "Indentation adjusted to be a multiple of four."), 911 "Indentation adjusted to be a multiple of four."),
911 "FE121": QCoreApplication.translate( 912 "FIXE121": QCoreApplication.translate(
912 'CodeStyleFixer', 913 'CodeStyleFixer',
913 "Indentation of continuation line corrected."), 914 "Indentation of continuation line corrected."),
914 "FE124": QCoreApplication.translate( 915 "FIXE124": QCoreApplication.translate(
915 'CodeStyleFixer', 916 'CodeStyleFixer',
916 "Indentation of closing bracket corrected."), 917 "Indentation of closing bracket corrected."),
917 "FE122": QCoreApplication.translate( 918 "FIXE122": QCoreApplication.translate(
918 'CodeStyleFixer', 919 'CodeStyleFixer',
919 "Missing indentation of continuation line corrected."), 920 "Missing indentation of continuation line corrected."),
920 "FE123": QCoreApplication.translate( 921 "FIXE123": QCoreApplication.translate(
921 'CodeStyleFixer', 922 'CodeStyleFixer',
922 "Closing bracket aligned to opening bracket."), 923 "Closing bracket aligned to opening bracket."),
923 "FE125": QCoreApplication.translate( 924 "FIXE125": QCoreApplication.translate(
924 'CodeStyleFixer', 925 'CodeStyleFixer',
925 "Indentation level changed."), 926 "Indentation level changed."),
926 "FE126": QCoreApplication.translate( 927 "FIXE126": QCoreApplication.translate(
927 'CodeStyleFixer', 928 'CodeStyleFixer',
928 "Indentation level of hanging indentation changed."), 929 "Indentation level of hanging indentation changed."),
929 "FE127": QCoreApplication.translate( 930 "FIXE127": QCoreApplication.translate(
930 'CodeStyleFixer', 931 'CodeStyleFixer',
931 "Visual indentation corrected."), 932 "Visual indentation corrected."),
932 "FE201": QCoreApplication.translate( 933 "FIXE201": QCoreApplication.translate(
933 'CodeStyleFixer', 934 'CodeStyleFixer',
934 "Extraneous whitespace removed."), 935 "Extraneous whitespace removed."),
935 "FE225": QCoreApplication.translate( 936 "FIXE225": QCoreApplication.translate(
936 'CodeStyleFixer', 937 'CodeStyleFixer',
937 "Missing whitespace added."), 938 "Missing whitespace added."),
938 "FE221": QCoreApplication.translate( 939 "FIXE221": QCoreApplication.translate(
939 'CodeStyleFixer', 940 'CodeStyleFixer',
940 "Extraneous whitespace removed."), 941 "Extraneous whitespace removed."),
941 "FE231": QCoreApplication.translate( 942 "FIXE231": QCoreApplication.translate(
942 'CodeStyleFixer', 943 'CodeStyleFixer',
943 "Missing whitespace added."), 944 "Missing whitespace added."),
944 "FE251": QCoreApplication.translate( 945 "FIXE251": QCoreApplication.translate(
945 'CodeStyleFixer', 946 'CodeStyleFixer',
946 "Extraneous whitespace removed."), 947 "Extraneous whitespace removed."),
947 "FE261": QCoreApplication.translate( 948 "FIXE261": QCoreApplication.translate(
948 'CodeStyleFixer', 949 'CodeStyleFixer',
949 "Whitespace around comment sign corrected."), 950 "Whitespace around comment sign corrected."),
950 951
951 "FE302+": lambda n=1: translate( 952 "FIXE302+": lambda n=1: translate(
952 'CodeStyleFixer', 953 'CodeStyleFixer',
953 "%n blank line(s) inserted.", '', n), 954 "%n blank line(s) inserted.", '', n),
954 "FE302-": lambda n=1: translate( 955 "FIXE302-": lambda n=1: translate(
955 'CodeStyleFixer', 956 'CodeStyleFixer',
956 "%n superfluous lines removed", '', n), 957 "%n superfluous lines removed", '', n),
957 958
958 "FE303": QCoreApplication.translate( 959 "FIXE303": QCoreApplication.translate(
959 'CodeStyleFixer', 960 'CodeStyleFixer',
960 "Superfluous blank lines removed."), 961 "Superfluous blank lines removed."),
961 "FE304": QCoreApplication.translate( 962 "FIXE304": QCoreApplication.translate(
962 'CodeStyleFixer', 963 'CodeStyleFixer',
963 "Superfluous blank lines after function decorator removed."), 964 "Superfluous blank lines after function decorator removed."),
964 "FE401": QCoreApplication.translate( 965 "FIXE401": QCoreApplication.translate(
965 'CodeStyleFixer', 966 'CodeStyleFixer',
966 "Imports were put on separate lines."), 967 "Imports were put on separate lines."),
967 "FE501": QCoreApplication.translate( 968 "FIXE501": QCoreApplication.translate(
968 'CodeStyleFixer', 969 'CodeStyleFixer',
969 "Long lines have been shortened."), 970 "Long lines have been shortened."),
970 "FE502": QCoreApplication.translate( 971 "FIXE502": QCoreApplication.translate(
971 'CodeStyleFixer', 972 'CodeStyleFixer',
972 "Redundant backslash in brackets removed."), 973 "Redundant backslash in brackets removed."),
973 "FE701": QCoreApplication.translate( 974 "FIXE701": QCoreApplication.translate(
974 'CodeStyleFixer', 975 'CodeStyleFixer',
975 "Compound statement corrected."), 976 "Compound statement corrected."),
976 "FE702": QCoreApplication.translate( 977 "FIXE702": QCoreApplication.translate(
977 'CodeStyleFixer', 978 'CodeStyleFixer',
978 "Compound statement corrected."), 979 "Compound statement corrected."),
979 "FE711": QCoreApplication.translate( 980 "FIXE711": QCoreApplication.translate(
980 'CodeStyleFixer', 981 'CodeStyleFixer',
981 "Comparison to None/True/False corrected."), 982 "Comparison to None/True/False corrected."),
982 "FN804": QCoreApplication.translate( 983 "FIXN804": QCoreApplication.translate(
983 'CodeStyleFixer', 984 'CodeStyleFixer',
984 "'{0}' argument added."), 985 "'{0}' argument added."),
985 "FN806": QCoreApplication.translate( 986 "FIXN806": QCoreApplication.translate(
986 'CodeStyleFixer', 987 'CodeStyleFixer',
987 "'{0}' argument removed."), 988 "'{0}' argument removed."),
988 "FW291": QCoreApplication.translate( 989 "FIXW291": QCoreApplication.translate(
989 'CodeStyleFixer', 990 'CodeStyleFixer',
990 "Whitespace stripped from end of line."), 991 "Whitespace stripped from end of line."),
991 "FW292": QCoreApplication.translate( 992 "FIXW292": QCoreApplication.translate(
992 'CodeStyleFixer', 993 'CodeStyleFixer',
993 "newline added to end of file."), 994 "newline added to end of file."),
994 "FW391": QCoreApplication.translate( 995 "FIXW391": QCoreApplication.translate(
995 'CodeStyleFixer', 996 'CodeStyleFixer',
996 "Superfluous trailing blank lines removed from end of file."), 997 "Superfluous trailing blank lines removed from end of file."),
997 "FW603": QCoreApplication.translate( 998 "FIXW603": QCoreApplication.translate(
998 'CodeStyleFixer', 999 'CodeStyleFixer',
999 "'<>' replaced by '!='."), 1000 "'<>' replaced by '!='."),
1000 1001
1001 "FWRITE_ERROR": QCoreApplication.translate( 1002 "FIXWRITE_ERROR": QCoreApplication.translate(
1002 'CodeStyleFixer', 1003 'CodeStyleFixer',
1003 "Could not save the file! Skipping it. Reason: {0}"), 1004 "Could not save the file! Skipping it. Reason: {0}"),
1004 } 1005 }
1005 1006
1006 _messages_sample_args = { 1007 _messages_sample_args = {
1071 "A003": ["kwargs"], 1072 "A003": ["kwargs"],
1072 "A881": [60], 1073 "A881": [60],
1073 "A891": [5, 3], 1074 "A891": [5, 3],
1074 "A999": ["SyntaxError", "Invalid Syntax"], 1075 "A999": ["SyntaxError", "Invalid Syntax"],
1075 1076
1076 "FWRITE_ERROR": ["IOError"], 1077 "FIXWRITE_ERROR": ["IOError"],
1077 } 1078 }
1078 1079
1079 1080
1080 def getTranslatedMessage(message): 1081 def getTranslatedMessage(message):
1081 """ 1082 """
1082 Module function to get a translated and formatted message for a 1083 Module function to get a translated and formatted message for a
1083 given pyflakes message ID. 1084 given message ID.
1084 1085
1085 @param message the message ID (string) 1086 @param message the message ID
1086 @return translated and formatted message (string) 1087 @type str
1088 @return translated and formatted message
1089 @rtype str
1087 """ 1090 """
1088 if isinstance(message, list): 1091 if isinstance(message, list):
1089 message, args = message 1092 message, args = message
1090 else: 1093 else:
1091 args = [] 1094 args = []
1093 if message in _messages: 1096 if message in _messages:
1094 if isinstance(args, int): 1097 if isinstance(args, int):
1095 # Retranslate with correct plural form 1098 # Retranslate with correct plural form
1096 return _messages[message](args) 1099 return _messages[message](args)
1097 else: 1100 else:
1098 if message.startswith(('FD', 'FE', 'FN', 'FW')): 1101 if message.startswith(('FIXD', 'FIXE', 'FIXN', 'FIXW')):
1099 prefix = '' 1102 prefix = ''
1100 else: 1103 else:
1101 prefix = message + ' ' 1104 prefix = message + ' '
1102 return prefix + _messages[message].format(*args) 1105 return prefix + _messages[message].format(*args)
1103 elif ' ' in message: 1106 elif ' ' in message:

eric ide

mercurial