-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Script for ReportNodes internationalization #121
base: main
Are you sure you want to change the base?
Changes from all commits
318a3d7
f15d986
9d9db6b
01be60e
6b68927
5a1354e
d0812f4
8d80ca0
c18a051
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,6 @@ org.eclipse.jdt.groovy.core.prefs | |
|
||
# VS Code | ||
.vscode | ||
|
||
# Text Files | ||
**/dictionary.properties |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
path="$1" | ||
function getMessageTemplates() { | ||
grep -R "\\.withMessageTemplate" --exclude="*Test*" --include="*.java" "$path" | awk -F'"' '{sub(/[ \t]+$/, "", $2); sub(/[ \t]+$/, "", $3); print $2, $3, $4}' | sort -g | sed 's/,/=/' > temp.properties | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have missed it, but in the resulting dictionary, some keys have no message. protected void reportOnInconclusiveDryRun(ReportNode reportNode, String cause) {
reportNode.newReportNode()
.withMessageTemplate("networkModificationDryRun-failure",
"Dry-run failed for ${networkModification}. The issue is: ${dryRunError}")
.withUntypedValue("dryRunError", cause)
.withUntypedValue("networkModification", getName())
.add();
} |
||
echo "==== Duplicated keys ====" | ||
awk 'NF {print $1}' temp.properties | sort -g | uniq -d -c | ||
echo "==== End ====" | ||
olperr1 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
sort -u -t= -k1,1 temp.properties > dictionary.properties ; rm temp.properties | ||
chmod u+x dictionary.properties | ||
} | ||
|
||
function main() { | ||
getMessageTemplates | ||
echo "INFO : dictionary.properties generated successfully." | ||
} | ||
|
||
main |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
path="$1" | ||
function getReportNode() { | ||
grep --color='auto' -R "\\.withMessageTemplate" --exclude="*Test*" --exclude="*Reports.java" "$path" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you also add the |
||
} | ||
|
||
function main() { | ||
echo -e "\033[35;1;4m=== ReportNode calls out of ...Reports.java files ===\033[0m" | ||
getReportNode | ||
echo "==== End ====" | ||
|
||
} | ||
|
||
main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "exclude" and "include" should be switched in order to really exclude the test java files.