File tree Expand file tree Collapse file tree
src/main/java/ch/njol/skript/localization Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -211,9 +211,10 @@ public static PluralPair parsePlural(String input) {
211211 StringBuilder singular = new StringBuilder ();
212212 StringBuilder plural = new StringBuilder ();
213213 int part = 3 ; // 1 = singular, 2 = plural, 3 = both
214- int markerCount = StringUtils .count (input , '¦' ) + StringUtils .count (input , ':' ) ;
214+ char marker = '¦' ;
215+ int markerCount = StringUtils .count (input , marker );
215216 int last = 0 , c = -1 ;
216- while ((c = nextPluralMarker ( input , c )) != -1 ) {
217+ while ((c = input . indexOf ( marker , c + 1 )) != -1 ) {
217218 String x = input .substring (last , c );
218219 if ((part & 1 ) != 0 )
219220 singular .append (x );
@@ -236,14 +237,6 @@ public static PluralPair parsePlural(String input) {
236237 * @param plural The plural version of the parsed input if it exists, or a copy of the singular version.
237238 */
238239 public record PluralPair (String singular , String plural ) {}
239-
240- private static int nextPluralMarker (String input , int startIndex ) {
241- int pipeIndex = input .indexOf ('¦' , startIndex + 1 );
242- int colonIndex = input .indexOf (':' , startIndex + 1 );
243- if (pipeIndex == -1 )
244- return colonIndex ;
245- return pipeIndex ;
246- }
247240
248241 /**
249242 * Normalizes plural markers, i.e. increases the total number of markers to a multiple of 3 without changing the string's meaning.
You can’t perform that action at this time.
0 commit comments