Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 83b2543c8ecfaf20cce43e0817a1362b84f78870 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/******************************************************************************
 * Copyright (c) 2007, 2020 Borland Software Corporation, CEA LIST, Artal
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/ 
 * 
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors: 
 *    Anna Karjakina (Borland) - initial API and implementation
 *    Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - Bug 569174
 *****************************************************************************/
modeltype gmfgen uses "http://www.eclipse.org/papyrus/gmf/2020/GenModel";

library i18n;

helper i18nKeyForDefaultFileEditorErrorDialog(app : gmfgen::GenApplication) : String {
	return app.actionBarAdvisorClassName + '.DefaultFileEditor'
}

helper i18nKeyForDefaultEditorOpenErrorDialog(app : gmfgen::GenApplication) : String {
	return app.actionBarAdvisorClassName + '.DefaultEditorOpenError'
}

helper i18nKeyForWindowTitle(app : gmfgen::GenApplication) : String {
	return app.workbenchWindowAdvisorClassName + '.Title'
}

helper i18nKeyForAboutDialog(app : gmfgen::GenApplication) : String {
	return app.actionBarAdvisorClassName + '.AboutDialog'
}

helper titleKey(dialogKey : String) : String {
	return dialogKey + 'Title'
}

helper messageKey(dialogKey : String) : String {
	return dialogKey + 'Message'
}

helper i18nKeyForMenu(menuManager : gmfgen::GenMenuManager) : String {
	return 'ApplicationMenuName.' + menuManager.name
}

-- FIXME move out from i18n, has nothing to do with l10n
helper collectGenMenuManagers(allItems : OrderedSet(gmfgen::GenContributionItem)) : Sequence(gmfgen::GenMenuManager) {
	return collectAllContributionItems(allItems->asSequence())[gmfgen::GenMenuManager]
}

helper collectAllContributionItems(allItems : Sequence(gmfgen::GenContributionItem)) : Sequence(gmfgen::GenContributionManager) {
	-- FIXME simplify the expression
	return let managers = allItems[gmfgen::GenContributionManager] in managers->union(managers->collect(item | collectAllContributionItems(item.items->asSequence())))
}

helper i18nKeyForNewFileWizardFileLabel(app : gmfgen::GenApplication) : String {
	return wizardNewFileCreationPageClassName(app) + '.FileLabel'
}

helper i18nKeyForNewFileWizardBrowseButton(app : gmfgen::GenApplication) : String {
	return wizardNewFileCreationPageClassName(app) + '.BrowseButton'
}

helper i18nKeyForNewFileWizardSelectDialog(app : gmfgen::GenApplication) : String {
	return wizardNewFileCreationPageClassName(app) + '.SelectNewFileDialog'
}

helper i18nKeyForNewFileWizardEmpty(app : gmfgen::GenApplication) : String {
	return wizardNewFileCreationPageClassName(app) + '.EmptyFileNameError'
}

helper i18nKeyForNewFileWizardInvalid(app : gmfgen::GenApplication) : String {
	return wizardNewFileCreationPageClassName(app) + '.InvalidFileNameError'
}

helper wizardNewFileCreationPageClassName(app : gmfgen::GenApplication) : String {
	return 'WizardNewFileCreationPage'
}

Back to the top