comparison mercurial/crecord.py @ 30535:3899c358b45a

crecord: filter text via i18n There are some text in the user interface that are not filtered by i18n. This patch adds the missing "_" call. So the text could be translated.
author Jun Wu <quark@fb.com>
date Wed, 23 Nov 2016 18:13:11 +0000
parents 40fe96fc7cd2
children d4035372db8d
comparison
equal deleted inserted replaced
30534:c01033fb9864 30535:3899c358b45a
958 printstring(self.statuswin, self.errorstr, pairname='legend') 958 printstring(self.statuswin, self.errorstr, pairname='legend')
959 printstring(self.statuswin, 'Press any key to continue', 959 printstring(self.statuswin, 'Press any key to continue',
960 pairname='legend') 960 pairname='legend')
961 self.statuswin.refresh() 961 self.statuswin.refresh()
962 return 962 return
963 line1 = ("SELECT CHUNKS: (j/k/up/dn/pgup/pgdn) move cursor; " 963 line1 = _("SELECT CHUNKS: (j/k/up/dn/pgup/pgdn) move cursor; "
964 "(space/A) toggle hunk/all; (e)dit hunk;") 964 "(space/A) toggle hunk/all; (e)dit hunk;")
965 line2 = (" (f)old/unfold; (c)onfirm applied; (q)uit; (?) help " 965 line2 = _(" (f)old/unfold; (c)onfirm applied; (q)uit; (?) help "
966 "| [X]=hunk applied **=folded, toggle [a]mend mode") 966 "| [X]=hunk applied **=folded, toggle [a]mend mode")
967 967
968 printstring(self.statuswin, 968 printstring(self.statuswin,
969 util.ellipsis(line1, self.xscreensize - 1), 969 util.ellipsis(line1, self.xscreensize - 1),
970 pairname="legend") 970 pairname="legend")
971 printstring(self.statuswin, 971 printstring(self.statuswin,
1303 "same as getcolorpair." 1303 "same as getcolorpair."
1304 self.getcolorpair(*args, **kwargs) 1304 self.getcolorpair(*args, **kwargs)
1305 1305
1306 def helpwindow(self): 1306 def helpwindow(self):
1307 "print a help window to the screen. exit after any keypress." 1307 "print a help window to the screen. exit after any keypress."
1308 helptext = """ [press any key to return to the patch-display] 1308 helptext = _(
1309 """ [press any key to return to the patch-display]
1309 1310
1310 crecord allows you to interactively choose among the changes you have made, 1311 crecord allows you to interactively choose among the changes you have made,
1311 and confirm only those changes you select for further processing by the command 1312 and confirm only those changes you select for further processing by the command
1312 you are running (commit/shelve/revert), after confirming the selected 1313 you are running (commit/shelve/revert), after confirming the selected
1313 changes, the unselected changes are still present in your working copy, so you 1314 changes, the unselected changes are still present in your working copy, so you
1327 e : edit the currently selected hunk 1328 e : edit the currently selected hunk
1328 a : toggle amend mode, only with commit -i 1329 a : toggle amend mode, only with commit -i
1329 c : confirm selected changes 1330 c : confirm selected changes
1330 r : review/edit and confirm selected changes 1331 r : review/edit and confirm selected changes
1331 q : quit without confirming (no changes will be made) 1332 q : quit without confirming (no changes will be made)
1332 ? : help (what you're currently reading)""" 1333 ? : help (what you're currently reading)""")
1333 1334
1334 helpwin = curses.newwin(self.yscreensize, 0, 0, 0) 1335 helpwin = curses.newwin(self.yscreensize, 0, 0, 0)
1335 helplines = helptext.split("\n") 1336 helplines = helptext.split("\n")
1336 helplines = helplines + [" "]*( 1337 helplines = helplines + [" "]*(
1337 self.yscreensize - self.numstatuslines - len(helplines) - 1) 1338 self.yscreensize - self.numstatuslines - len(helplines) - 1)
1366 return response 1367 return response
1367 1368
1368 def reviewcommit(self): 1369 def reviewcommit(self):
1369 """ask for 'y' to be pressed to confirm selected. return True if 1370 """ask for 'y' to be pressed to confirm selected. return True if
1370 confirmed.""" 1371 confirmed."""
1371 confirmtext = ( 1372 confirmtext = _(
1372 """if you answer yes to the following, the your currently chosen patch chunks 1373 """if you answer yes to the following, the your currently chosen patch chunks
1373 will be loaded into an editor. you may modify the patch from the editor, and 1374 will be loaded into an editor. you may modify the patch from the editor, and
1374 save the changes if you wish to change the patch. otherwise, you can just 1375 save the changes if you wish to change the patch. otherwise, you can just
1375 close the editor without saving to accept the current patch as-is. 1376 close the editor without saving to accept the current patch as-is.
1376 1377
1398 try: 1399 try:
1399 ver = float(util.version()[:3]) 1400 ver = float(util.version()[:3])
1400 except ValueError: 1401 except ValueError:
1401 ver = 1 1402 ver = 1
1402 if ver < 2.19: 1403 if ver < 2.19:
1403 msg = ("The amend option is unavailable with hg versions < 2.2\n\n" 1404 msg = _("The amend option is unavailable with hg versions < 2.2\n\n"
1404 "Press any key to continue.") 1405 "Press any key to continue.")
1405 elif opts.get('amend') is None: 1406 elif opts.get('amend') is None:
1406 opts['amend'] = True 1407 opts['amend'] = True
1407 msg = ("Amend option is turned on -- committing the currently " 1408 msg = _("Amend option is turned on -- committing the currently "
1408 "selected changes will not create a new changeset, but " 1409 "selected changes will not create a new changeset, but "
1409 "instead update the most recently committed changeset.\n\n" 1410 "instead update the most recently committed changeset.\n\n"
1410 "Press any key to continue.") 1411 "Press any key to continue.")
1411 elif opts.get('amend') is True: 1412 elif opts.get('amend') is True:
1412 opts['amend'] = None 1413 opts['amend'] = None
1413 msg = ("Amend option is turned off -- committing the currently " 1414 msg = _("Amend option is turned off -- committing the currently "
1414 "selected changes will create a new changeset.\n\n" 1415 "selected changes will create a new changeset.\n\n"
1415 "Press any key to continue.") 1416 "Press any key to continue.")
1416 if not test: 1417 if not test:
1417 self.confirmationwindow(msg) 1418 self.confirmationwindow(msg)
1418 1419
1419 def recenterdisplayedarea(self): 1420 def recenterdisplayedarea(self):
1420 """ 1421 """