translated text. */ public static function get(string $group): array { $groups = self::groups(); return isset($groups[ $group ]) ? (array) call_user_func($groups[ $group ]) : []; } /** admin.js: every admin screen. */ public static function admin(): array { return [ // Model tab. 'connected' => __('Connected', 'resolver-ai-chatbot'), 'notConnected' => __('Not connected.', 'resolver-ai-chatbot'), 'enterApiKey' => __('Enter API Key', 'resolver-ai-chatbot'), 'chooseModel' => __('Choose an AI model', 'resolver-ai-chatbot'), 'chooseProviderFirst' => __('Choose an AI platform first', 'resolver-ai-chatbot'), 'upgradeEmbeddingModel' => __('Upgrade embedding model', 'resolver-ai-chatbot'), 'upgrading' => __('Upgrading…', 'resolver-ai-chatbot'), 'upgradeFailed' => __('Could not start the upgrade. Please try again.', 'resolver-ai-chatbot'), 'retrainingInProgress' => __('Retraining in progress…', 'resolver-ai-chatbot'), 'upgradeComplete' => __('Retraining complete. Your embedding model has been upgraded.', 'resolver-ai-chatbot'), 'dismiss' => __('Dismiss', 'resolver-ai-chatbot'), /* translators: %s: name of the training platform chosen, e.g. Google Gemini. */ 'providerSwitch' => __('Saving will retrain all of your content with %s, and take you to the Training menu to follow along.', 'resolver-ai-chatbot'), /* translators: %s: name of the training platform chosen, e.g. Google Gemini. */ 'providerSwitchNotConnected' => __('Connect %s before switching to it, since saving will retrain all of your content with it.', 'resolver-ai-chatbot'), 'providerSwitchTraining' => __('Training is in progress. You can switch training platforms once it finishes.', 'resolver-ai-chatbot'), 'embeddingModel' => __('Model:', 'resolver-ai-chatbot'), 'embeddingProviderDesc' => __('This can be different than the AI platform you select. Anthropic does not have an API for training/embedding.', 'resolver-ai-chatbot'), // Training tab. 'enableEditing' => __('Enable Editing', 'resolver-ai-chatbot'), 'disableEditing' => __('Disable Editing', 'resolver-ai-chatbot'), 'train' => __('Train', 'resolver-ai-chatbot'), 'training' => __('Training', 'resolver-ai-chatbot'), 'trained' => __('Trained', 'resolver-ai-chatbot'), 'error' => __('Error', 'resolver-ai-chatbot'), 'cannotDelete' => __('Cannot delete while training', 'resolver-ai-chatbot'), 'cannotReindex' => __('Cannot re-index while training', 'resolver-ai-chatbot'), /* translators: 1: number of items selected. 2: number of items listed. */ 'selectedCount' => __('%1$s/%2$s selected', 'resolver-ai-chatbot'), 'trainingBeginning' => __('Training beginning…', 'resolver-ai-chatbot'), 'trainingFailed' => __('Could not start training. Please try again.', 'resolver-ai-chatbot'), 'trainingComplete' => __('Training complete', 'resolver-ai-chatbot'), 'extractingPdfs' => __('Extracting text from PDFs', 'resolver-ai-chatbot'), // Visibility tab. 'noResults' => __('No results found', 'resolver-ai-chatbot'), 'remove' => __('Remove', 'resolver-ai-chatbot'), // Chats tab. 'selectChat' => __('Select a chat to view messages', 'resolver-ai-chatbot'), 'closeConversation' => __('Close conversation', 'resolver-ai-chatbot'), 'admin' => __('Admin', 'resolver-ai-chatbot'), 'model' => __('Model:', 'resolver-ai-chatbot'), 'tokensUsed' => __('Tokens used:', 'resolver-ai-chatbot'), 'messages' => __('Messages:', 'resolver-ai-chatbot'), 'loadMessagesFailed' => __('Failed to load messages.', 'resolver-ai-chatbot'), 'noMessages' => __('No messages found.', 'resolver-ai-chatbot'), 'connectionFailed' => __('Could not connect to server.', 'resolver-ai-chatbot'), 'confirmDeleteChat' => __('Are you sure you want to delete this chat? This cannot be undone.', 'resolver-ai-chatbot'), 'deleteChatFailed' => __('Failed to delete chat.', 'resolver-ai-chatbot'), 'noConversations' => __('No conversations found.', 'resolver-ai-chatbot'), 'newerConversations' => __('Newer conversations', 'resolver-ai-chatbot'), 'olderConversations' => __('Older conversations', 'resolver-ai-chatbot'), // Settings form. 'unsavedChanges' => __('Unsaved changes', 'resolver-ai-chatbot'), 'settingsSaved' => __('Saved', 'resolver-ai-chatbot'), 'saveFailed' => __('Could not save your changes', 'resolver-ai-chatbot'), /* translators: %s: percentage of the monthly token limit used so far. */ 'tokenLimitUsed' => __('%s%% of monthly token limit used', 'resolver-ai-chatbot'), ]; } /** admin-charts.js: the dashboard's token chart. */ public static function charts(): array { return [ 'inputTokens' => __('Input tokens', 'resolver-ai-chatbot'), 'outputTokens' => __('Output tokens', 'resolver-ai-chatbot'), 'trainingTokens' => __('Training tokens', 'resolver-ai-chatbot'), ]; } /** chat-widget.js: the chat widget, on the site and in the admin preview. */ public static function widget(): array { return [ // Shown if the site owner clears the bot name. 'botName' => __('AI Assistant', 'resolver-ai-chatbot'), 'helpful' => __('Helpful', 'resolver-ai-chatbot'), // How long ago a message was sent, updated every minute. 'justNow' => __('just now', 'resolver-ai-chatbot'), /* translators: %s: number of minutes. Abbreviated, so it reads the same for any number. */ 'minutesAgo' => __('%s min ago', 'resolver-ai-chatbot'), /* translators: %s: number of hours. Abbreviated, so it reads the same for any number. */ 'hoursAgo' => __('%s hr ago', 'resolver-ai-chatbot'), 'notHelpful' => __('Not helpful', 'resolver-ai-chatbot'), 'tooManyMessages' => __('Too many messages. Please wait a minute before trying again.', 'resolver-ai-chatbot'), 'requestFailed' => __('Something went wrong. Please try again.', 'resolver-ai-chatbot'), ]; } /** * Group name => callable returning its strings. */ private static function groups(): array { /** * Filter the script string groups. Pro adds the groups for its scripts. * * @param array $groups Group name => callable returning its strings. */ return (array) apply_filters('resolver_script_string_groups', [ 'admin' => [self::class, 'admin'], 'charts' => [self::class, 'charts'], 'widget' => [self::class, 'widget'], ]); } }