@@ -303,6 +303,112 @@ public sealed interface ComponentBundle permits ComponentBundleImpl {
303303 @ Contract (value = "_, _, _ -> new" , pure = true )
304304 Component component (@ NonNls String translationKey , Locale locale , TagResolver ... resolvers );
305305
306+ /**
307+ * Creates an array of {@link Component Components} based on the provided translation key and locale.
308+ * Each line separated by {@code <br>}, {@code <newline>}, or {@code \n} is returned as a separate component.
309+ * <p>
310+ * Opposed to {@link #translate(String, Audience)},
311+ * this method does not return null if the translation could not be resolved.
312+ * Instead, it returns an array containing a red text component with the translation key.
313+ *
314+ * @param translationKey the key used to retrieve the localized translation
315+ * @param audience the {@link Audience} to determine the locale used for the translation
316+ * @return an array containing one localized {@link Component} per line
317+ * @see #translate(String, Audience)
318+ * @since 1.3.0
319+ */
320+ @ Contract (value = "_, _ -> new" , pure = true )
321+ Component [] components (@ NonNls String translationKey , Audience audience );
322+
323+ /**
324+ * Translates a given translation key into an array of localized {@link Component Components} for the specified
325+ * {@link Audience}, with optional arguments for formatting arguments within the translation.
326+ * Each line separated by {@code <br>}, {@code <newline>}, or {@code \n} is returned as a separate component.
327+ * <p>
328+ * Opposed to {@link #translate(String, Audience, ComponentLike...)},
329+ * this method does not return null if the translation could not be resolved.
330+ * Instead, it returns an array containing a red text component with the translation key.
331+ *
332+ * @param translationKey the translation key representing the entry to be localized
333+ * @param audience the {@link Audience} to determine the locale used for the translation
334+ * @param arguments optional {@link ComponentLike} arguments used to replace arguments within the translation
335+ * @return an array containing one translated {@link Component} per line
336+ * @see #translate(String, Audience, ComponentLike...)
337+ * @since 1.3.0
338+ */
339+ @ Contract (value = "_, _, _ -> new" , pure = true )
340+ Component [] components (@ NonNls String translationKey , Audience audience , ComponentLike ... arguments );
341+
342+ /**
343+ * Translates a given translation key into an array of localized {@link Component Components} for the specified
344+ * {@link Audience}, with optional tag resolvers for formatting arguments within the translation.
345+ * Each line separated by {@code <br>}, {@code <newline>}, or {@code \n} is returned as a separate component.
346+ * <p>
347+ * This method does not return null if the translation could not be resolved.
348+ * Instead, it returns an array containing a red text component with the translation key.
349+ *
350+ * @param translationKey the translation key representing the entry to be localized
351+ * @param audience the {@link Audience} to determine the locale used for the translation
352+ * @param resolvers optional {@link TagResolver} arguments used for resolving tags within the translation
353+ * @return an array containing one translated {@link Component} per line
354+ * @since 1.3.0
355+ */
356+ @ Contract (value = "_, _, _ -> new" , pure = true )
357+ Component [] components (@ NonNls String translationKey , Audience audience , TagResolver ... resolvers );
358+
359+ /**
360+ * Creates an array of {@link Component Components} based on the provided translation key and locale.
361+ * Each line separated by {@code <br>}, {@code <newline>}, or {@code \n} is returned as a separate component.
362+ * <p>
363+ * Opposed to {@link #translate(String, Locale)},
364+ * this method does not return null if the translation could not be resolved.
365+ * Instead, it returns an array containing a red text component with the translation key.
366+ *
367+ * @param translationKey the key used to retrieve the localized translation
368+ * @param locale the locale that determines the language and formatting of the translation
369+ * @return an array containing one localized {@link Component} per line
370+ * @see #translate(String, Locale)
371+ * @since 1.3.0
372+ */
373+ @ Contract (value = "_, _ -> new" , pure = true )
374+ Component [] components (@ NonNls String translationKey , Locale locale );
375+
376+ /**
377+ * Translates a given translation key into an array of localized {@link Component Components},
378+ * with optional arguments for formatting arguments within the translation.
379+ * Each line separated by {@code <br>}, {@code <newline>}, or {@code \n} is returned as a separate component.
380+ * <p>
381+ * Opposed to {@link #translate(String, Locale, ComponentLike...)},
382+ * this method does not return null if the translation could not be resolved.
383+ * Instead, it returns an array containing a red text component with the translation key.
384+ *
385+ * @param translationKey the translation key representing the entry to be localized
386+ * @param locale the locale that determines the language and formatting of the translation
387+ * @param arguments optional {@link ComponentLike} arguments used to replace arguments within the translation
388+ * @return an array containing one translated {@link Component} per line
389+ * @see #translate(String, Locale, ComponentLike...)
390+ * @since 1.3.0
391+ */
392+ @ Contract (value = "_, _, _ -> new" , pure = true )
393+ Component [] components (@ NonNls String translationKey , Locale locale , ComponentLike ... arguments );
394+
395+ /**
396+ * Translates a given translation key into an array of localized {@link Component Components},
397+ * with optional tag resolvers for formatting arguments within the translation.
398+ * Each line separated by {@code <br>}, {@code <newline>}, or {@code \n} is returned as a separate component.
399+ * <p>
400+ * This method does not return null if the translation could not be resolved.
401+ * Instead, it returns an array containing a red text component with the translation key.
402+ *
403+ * @param translationKey the translation key representing the entry to be localized
404+ * @param locale the locale that determines the language and formatting of the translation
405+ * @param resolvers optional {@link TagResolver} arguments used for resolving tags within the translation
406+ * @return an array containing one translated {@link Component} per line
407+ * @since 1.3.0
408+ */
409+ @ Contract (value = "_, _, _ -> new" , pure = true )
410+ Component [] components (@ NonNls String translationKey , Locale locale , TagResolver ... resolvers );
411+
306412 /**
307413 * A builder interface for constructing a {@link ComponentBundle}.
308414 */
0 commit comments