eric6/Plugins/CheckerPlugins/SyntaxChecker/pyflakes/translations.py

branch
maintenance
changeset 7642
72721823d453
parent 7635
0cdead130a81
child 7709
7c3968742fd2
equal deleted inserted replaced
7608:f7cb83647621 7642:72721823d453
160 'pyFlakes', 160 'pyFlakes',
161 "'...' % ... expected sequence but got mapping"), 161 "'...' % ... expected sequence but got mapping"),
162 'F48': QCoreApplication.translate( 162 'F48': QCoreApplication.translate(
163 'pyFlakes', 163 'pyFlakes',
164 "'...' % ... `*` specifier requires sequence"), 164 "'...' % ... `*` specifier requires sequence"),
165 'F49': QCoreApplication.translate(
166 'pyFlakes',
167 "'if tuple literal' is always true, perhaps remove accidental comma?"
168 ),
165 } 169 }
166 170
167 171
168 def getTranslatedFlakesMessage(message_id, message_args): 172 def getTranslatedFlakesMessage(message_id, message_args):
169 """ 173 """
173 @param message_id message ID (string) 177 @param message_id message ID (string)
174 @param message_args arguments for a formatted message (list) 178 @param message_args arguments for a formatted message (list)
175 @return translated and formatted message (string) 179 @return translated and formatted message (string)
176 """ 180 """
177 if message_id in _messages: 181 if message_id in _messages:
178 # Avoid leading "u" at Python2 unicode strings
179 msg = _messages[message_id].replace("{0!r}", "'{0}'") 182 msg = _messages[message_id].replace("{0!r}", "'{0}'")
180 msg = msg.replace("{1!r}", "'{1}'") 183 msg = msg.replace("{1!r}", "'{1}'")
181 return msg.format(*message_args) 184 return msg.format(*message_args)
182 else: 185 else:
183 return QCoreApplication.translate( 186 return QCoreApplication.translate(

eric ide

mercurial