Skip to content

Commit

Permalink
GUI Tools messages: refined the messages and hooked them up.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbluer committed Apr 29, 2024
1 parent 7557b13 commit d92f929
Show file tree
Hide file tree
Showing 17 changed files with 157 additions and 70 deletions.
3 changes: 3 additions & 0 deletions docs/changelog_v3.3.x.md
Expand Up @@ -17,6 +17,9 @@ These change logs represent the work that has been going on within prison.
# 3.3.0-alpha.17 2024-04-29


* **GUI Tools messages: refined the messages and hooked them up.**


* **Initial setup of the GUI tools messages that are at the bottom of a page.**
Setup the handling of the messages and added the messages to all of the language files.
Support for prior, current, and next page. Also close.
Expand Down
Expand Up @@ -145,15 +145,25 @@ protected String guiPageToolsCloseMsg() {
.getLocalizable( "core_gui__page_tools_close" )
.localize();
}
protected String guiPageToolsGoBackMsg() {

return Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_go_back" )
.localize();
}
private String formmatPageToolsPlaceholders( String msg, int currentPage, int maxPage ) {

if ( maxPage < 1 ) {
maxPage = 1;
}
int priorPage = currentPage == 1 ? 1 : currentPage - 1;
int nextPage = currentPage == maxPage ? maxPage : currentPage + 1;

msg = msg.replace("{prior_page}", Integer.toString(priorPage) )
msg = msg.replace("{first_page}", "1" )
.replace("{prior_page}", Integer.toString(priorPage) )
.replace("{current_page}", Integer.toString(currentPage))
.replace("{next_page}", Integer.toString(nextPage))
.replace("{max_page}", Integer.toString(maxPage))
.replace("{last_page}", Integer.toString(maxPage))
;

return msg;
Expand All @@ -166,6 +176,14 @@ protected String guiPageToolsCloseMsg( int currentPage, int maxPage ) {

return formmatPageToolsPlaceholders( msg, currentPage, maxPage );
}
protected String guiPageToolsFirstPageMsg( int currentPage, int maxPage ) {

String msg = Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_first_page" )
.localize();

return formmatPageToolsPlaceholders( msg, currentPage, maxPage );
}
protected String guiPageToolsPriorPageMsg( int currentPage, int maxPage ) {

String msg = Prison.get().getLocaleManager()
Expand All @@ -190,6 +208,15 @@ protected String guiPageToolsNextPageMsg( int currentPage, int maxPage ) {

return formmatPageToolsPlaceholders( msg, currentPage, maxPage );
}
protected String guiPageToolsLastPageMsg( int currentPage, int maxPage ) {

String msg = Prison.get().getLocaleManager()
.getLocalizable( "core_gui__page_tools_last_page" )
.localize();

return formmatPageToolsPlaceholders( msg, currentPage, maxPage );
}



protected String guiPriceMsg( Double price ) {
Expand Down
11 changes: 7 additions & 4 deletions prison-core/src/main/resources/lang/core/de_DE.properties
Expand Up @@ -185,11 +185,14 @@ core_gui__page_prior=&3Prior page.
# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
# {first_page} {prior_page} {current_page} {next_page} {last_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}
core_gui__page_tools_go_back=&3Go Back
core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page}
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page}
core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page}


core_gui__money_earned=&3You earned &a$%1
Expand Down
11 changes: 7 additions & 4 deletions prison-core/src/main/resources/lang/core/en_GB.properties
Expand Up @@ -185,11 +185,14 @@ core_gui__page_prior=&3Prior page.
# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
# {first_page} {prior_page} {current_page} {next_page} {last_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}
core_gui__page_tools_go_back=&3Go Back
core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page}
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page}
core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page}


core_gui__money_earned=&3You earned &a$%1
Expand Down
11 changes: 7 additions & 4 deletions prison-core/src/main/resources/lang/core/en_US.properties
Expand Up @@ -185,11 +185,14 @@ core_gui__page_prior=&3Prior page.
# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
# {first_page} {prior_page} {current_page} {next_page} {last_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}
core_gui__page_tools_go_back=&3Go Back
core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page}
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page}
core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page}


core_gui__money_earned=&3You earned &a$%1
Expand Down
11 changes: 7 additions & 4 deletions prison-core/src/main/resources/lang/core/es_ES.properties
Expand Up @@ -185,11 +185,14 @@ core_gui__page_prior=&3Prior page.
# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
# {first_page} {prior_page} {current_page} {next_page} {last_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}
core_gui__page_tools_go_back=&3Go Back
core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page}
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page}
core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page}


core_gui__money_earned=&3You earned &a$%1
Expand Down
11 changes: 7 additions & 4 deletions prison-core/src/main/resources/lang/core/fi_FI.properties
Expand Up @@ -185,11 +185,14 @@ core_gui__page_prior=&3Prior page.
# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
# {first_page} {prior_page} {current_page} {next_page} {last_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}
core_gui__page_tools_go_back=&3Go Back
core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page}
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page}
core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page}


core_gui__money_earned=&3You earned &a$%1
Expand Down
11 changes: 7 additions & 4 deletions prison-core/src/main/resources/lang/core/fr_FR.properties
Expand Up @@ -185,11 +185,14 @@ core_gui__page_prior=&3Page précedente.
# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
# {first_page} {prior_page} {current_page} {next_page} {last_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}
core_gui__page_tools_go_back=&3Go Back
core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page}
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page}
core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page}


core_gui__money_earned=&3Vous avez gagné &a$%1
Expand Down
11 changes: 7 additions & 4 deletions prison-core/src/main/resources/lang/core/hu_HU.properties
Expand Up @@ -185,11 +185,14 @@ core_gui__page_prior=&3Prior page.
# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
# {first_page} {prior_page} {current_page} {next_page} {last_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}
core_gui__page_tools_go_back=&3Go Back
core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page}
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page}
core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page}


core_gui__money_earned=&3You earned &a$%1
Expand Down
11 changes: 7 additions & 4 deletions prison-core/src/main/resources/lang/core/it_IT.properties
Expand Up @@ -185,11 +185,14 @@ core_gui__page_prior=&3Prior page.
# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
# {first_page} {prior_page} {current_page} {next_page} {last_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}
core_gui__page_tools_go_back=&3Go Back
core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page}
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page}
core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page}


core_gui__money_earned=&3You earned &a$%1
Expand Down
11 changes: 7 additions & 4 deletions prison-core/src/main/resources/lang/core/nl_BE.properties
Expand Up @@ -185,11 +185,14 @@ core_gui__page_prior=&3Prior page.
# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
# {first_page} {prior_page} {current_page} {next_page} {last_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}
core_gui__page_tools_go_back=&3Go Back
core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page}
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page}
core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page}


core_gui__money_earned=&3You earned &a$%1
Expand Down
11 changes: 7 additions & 4 deletions prison-core/src/main/resources/lang/core/nl_NL.properties
Expand Up @@ -185,11 +185,14 @@ core_gui__page_prior=&3Prior page.
# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
# {first_page} {prior_page} {current_page} {next_page} {last_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}
core_gui__page_tools_go_back=&3Go Back
core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page}
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page}
core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page}


core_gui__money_earned=&3You earned &a$%1
Expand Down
11 changes: 7 additions & 4 deletions prison-core/src/main/resources/lang/core/pt_PT.properties
Expand Up @@ -185,11 +185,14 @@ core_gui__page_prior=&3Pagina anterior.
# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
# {first_page} {prior_page} {current_page} {next_page} {last_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}
core_gui__page_tools_go_back=&3Go Back
core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page}
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page}
core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page}


core_gui__money_earned=&3You earned &a$%1
Expand Down
11 changes: 7 additions & 4 deletions prison-core/src/main/resources/lang/core/ro_RO.properties
Expand Up @@ -185,11 +185,14 @@ core_gui__page_prior=&3Prior page.
# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
# {first_page} {prior_page} {current_page} {next_page} {last_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}
core_gui__page_tools_go_back=&3Go Back
core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page}
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page}
core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page}


core_gui__money_earned=&3You earned &a$%1
Expand Down
11 changes: 7 additions & 4 deletions prison-core/src/main/resources/lang/core/zh-CN.properties
Expand Up @@ -185,11 +185,14 @@ core_gui__page_prior=&3上一页
# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
# {first_page} {prior_page} {current_page} {next_page} {last_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}
core_gui__page_tools_go_back=&3Go Back
core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page}
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page}
core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page}


core_gui__money_earned=&3You earned &a$%1
Expand Down
11 changes: 7 additions & 4 deletions prison-core/src/main/resources/lang/core/zh_TW.properties
Expand Up @@ -185,11 +185,14 @@ core_gui__page_prior=&3Prior page.
# Note: The core_gui__page_tools_ messages all use the following placeholders
# so you can structure them any way you need to. You not no have to use
# any of them, but you can also use all of them.
# {prior_page} {current_page} {next_page} {max_page}
# {first_page} {prior_page} {current_page} {next_page} {last_page}
core_gui__page_tools_close=&3Close
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {max_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {max_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {max_page}
core_gui__page_tools_go_back=&3Go Back
core_gui__page_tools_first_page=&3Prior page: {first_page} of {last_page}
core_gui__page_tools_prior_page=&3Prior page: {prior_page} of {last_page}
core_gui__page_tools_current_page=&3Current page: {current_page} of {last_page}
core_gui__page_tools_next_page=&3Next page: {next_page} of {last_page}
core_gui__page_tools_last_page=&3Last page: {last_page} of {last_page}


core_gui__money_earned=&3You earned &a$%1
Expand Down

0 comments on commit d92f929

Please sign in to comment.