@Override
	public void translate(Program program, List<ProgramLocation> stringLocations,
			TranslateOptions options) {
		TaskLauncher.launchModal("Manually translate strings", monitor -> {

			int id = program.startTransaction("Translate strings");
			try {
				for (int instanceNum = 0; instanceNum < stringLocations.size(); instanceNum++) {
					ProgramLocation progLoc = stringLocations.get(instanceNum);
					Data data = DataUtilities.getDataAtLocation(progLoc);
					StringDataInstance stringData = StringDataInstance.getStringDataInstance(data);
					String strValue = stringData.getStringValue();
					if (strValue != null) {
						strValue = strValue.length() > MAX_STR_PROMPT
								? strValue.substring(0, MAX_STR_PROMPT) + "..."
								: strValue;
						String previous =
							StringUtils.defaultString(stringData.getTranslatedValue());
						String translatedValue = OptionDialog.showInputSingleLineDialog(null,
							"Translate " + (instanceNum + 1) + " of " + stringLocations.size(),
							"Translate \"" + strValue + "\"", previous);
						if (translatedValue == null) {
							break;
						}
						if (!translatedValue.trim().isEmpty()) {
							TRANSLATION.setTranslatedValue(data, translatedValue);
							TRANSLATION.setShowTranslated(data, true);
						}
					}
				}
			}
			finally {
				program.endTransaction(id, true);
			}
		});
	}
This class allows users to manually translate strings.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/string/translate/ManualStringTranslationService.java