Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#37 2018-03-14 06:54:23
- gomedia
- Plugin Author
- Registered: 2008-06-01
- Posts: 1,373
Re: Fatal error when I upgrade a 4.7 dev site with plugins
Here’s another thought bubble.
Could it be the case that if the plugin has all the string/event mappings then the external mega-textpack wouldn’t need to be so detailed. When it’s loaded in, the non-English strings would be slotted into the table following the same scheme.
In other words the embedded textpack in the plugin (or even the block of English strings in a textpack file) would define the “schema”.
Offline
Re: Fatal error when I upgrade a 4.7 dev site with plugins
@adi:
I’ve been tinkering with your Textpack. As far as I can work out, the following structure works well. Whether it aligns with your way of working I’m not sure, but this pack can be pasted into the Languages panel to install all other languages for the adi_matrix plugin and some of the ‘shared’ things on the admin side that are common to all your plugins:
#@owner gomedia
###########################################
######## Shared admin-side strings ########
###########################################
#@admin-side
#@language en, en-gb, en-us, en-ca
tab_recent => Recent
adi_alphabetical => Alphabetical
adi_any_category => Any category
adi_any_child_category => Any child category
adi_blank_url_title => URL-only title blank
adi_cancel => Cancel
adi_cf_links => Custom field links
adi_default_sort => Default sort
adi_display_article_id => Display article ID#
adi_duplicate_url_title => URL-only title already used
adi_edit_titles => Edit titles
adi_footer => Footer
adi_has_expiry => Has expiry
adi_install_fail => Unable to install
adi_installed => Installed
adi_invalid_timestamp => Invalid timestamp
adi_jquery_ui => jQuery UI script file
adi_jquery_ui_css => jQuery UI CSS file
adi_logged_in_user => Logged in user
adi_new_article => New article
adi_no_category => No category
adi_no_expiry => No expiry
adi_not_installed => Not installed
adi_numerical => Numerical
adi_ok => OK
adi_one_category => One category
adi_any_parent_category => Any parent category
adi_pref_update_fail => Preference update failed
adi_reset => Reset
adi_scroll => Scroll
adi_show_section => Show section
adi_sort_type => Sort type
adi_tab => Tab
adi_textpack_fail => Textpack installation failed
adi_textpack_feedback => Textpack feedback
adi_textpack_online => Textpack also available online
adi_tiny_mce => TinyMCE
adi_tiny_mce_dir_path => TinyMCE directory path
adi_tiny_mce_hak => TinyMCE (hak_tinymce)
adi_tiny_mce_javascript => TinyMCE (Javascript)
adi_tiny_mce_jquery => TinyMCE (jQuery)
adi_tiny_mce_config => TinyMCE configuration
adi_two_categories => Two categories
adi_uninstall => Uninstall
adi_uninstall_fail => Unable to uninstall
adi_uninstalled => Uninstalled
adi_update_prefs => Update preferences
adi_upgrade_fail => Unable to upgrade
adi_upgrade_required => Upgrade required
adi_upgraded => Upgraded
adi_user => User
#@language cs
adi_install_fail => Nelze nainstalovat
adi_installed => Nainstalováno
adi_not_installed => Nenainstalováno
adi_textpack_fail => Instalace textového balíčku se nezdařila
adi_textpack_feedback => Textový balíček - zpětná odezva
adi_textpack_online => Textový balíček je rovněž dostupný online
adi_uninstall => Odinstalovat
adi_uninstall_fail => Nelze odinstalovat
adi_uninstalled => Odinstalováno
adi_upgrade_fail => Nelze aktualizovat
adi_upgrade_required => Vyžadována aktualizace
adi_upgraded => Aktualizováno
#@language de
tab_recent => Benutzte Objekte
adi_install_fail => Installation nicht möglich
adi_installed => Installiert
adi_not_installed => Nicht installiert
adi_textpack => Textpack
adi_textpack_fail => Textpack-Installation fehlgeschlagen
adi_textpack_feedback => Textpack-Feedback
adi_textpack_online => Textpack ist auch online verfügbar
adi_uninstall => Deinstallieren
adi_uninstall_fail => Deinstallation fehlgeschlagen
adi_uninstalled => Deinstalliert
adi_upgrade_fail => Upgrade nicht möglich
adi_upgrade_required => Upgrade benötigt
adi_upgraded => Upgrade erfolgreich
#@language es
adi_install_fail => Fallo en la instalación
adi_installed => Instalado correctamente
adi_not_installed => No instalado
adi_textpack_fail => Fallo al intentar instalar el paquete de idioma
adi_textpack_feedback => Textpack feedback
adi_textpack_online => Textpack también está disponible online
adi_uninstall => Desinstalar
adi_uninstall_fail => Imposible desinstalar
adi_uninstalled => Desinstalado
adi_upgrade_fail => Imposible actualizar
adi_upgrade_required => Actualización requerida
adi_upgraded => Actualizado
#@language fr
adi_install_fail => Impossible d'installer
adi_installed => Installé
adi_not_installed => Non installé
adi_textpack => Textpack
adi_textpack_fail => L'installation du "Textpack" a échoué
adi_textpack_feedback => Suggestions sur le "Textpack"
adi_textpack_online => "Textpack" est également disponible en ligne
adi_uninstall => Désinstaller
adi_uninstall_fail => Impossible de désinstaller
adi_uninstalled => Désinstallé
adi_upgrade_fail => Impossible de faire la mise à niveau
adi_upgrade_required => Mise à niveau nécessaire
adi_upgraded => Mise à niveau faite
#@language it
adi_install_fail => Impossibile installare
adi_installed => Installato
adi_not_installed => Non installato
adi_textpack_fail => Installazione del Textpack fallita
adi_textpack_feedback => Textpack feedback
adi_textpack_online => Textpack è disponibile anche online
adi_uninstall => Disinstalla
adi_uninstall_fail => Impossibile disinstallare
adi_uninstalled => Disinstallato
adi_upgrade_fail => Aggiornamento fallito
adi_upgrade_required => Aggiornamento richiesto
adi_upgraded => Aggiornato
#@language ja
adi_install_fail => インストールに失敗しました
adi_installed => インストールしました
adi_not_installed => インストールされていません
adi_textpack => 言語パック
adi_textpack_fail => 言語パックのインストールに失敗しました
adi_textpack_feedback => 言語パックのフィードバック
adi_textpack_online => 言語パックのオンラインダウンロード
adi_uninstall => アンインストール
adi_uninstall_fail => アンインストールに失敗しました
adi_uninstalled => アンインストールしました
adi_upgrade_fail => 更新に失敗しました
adi_upgrade_required => 更新が必要です
adi_upgraded => 更新しました
#@language pl
adi_install_fail => Nie można zainstalować
adi_installed => Zainstalowano
adi_not_installed => Nie zainstalowano
adi_textpack_fail => Instalacja Textpacka nie powiodła się
adi_textpack_feedback => Uwagi na temat Textpacka
adi_textpack_online => Textpack jest również dostępny online
adi_uninstall => Odinstaluj
adi_uninstall_fail => Nie udało się odinstalować
adi_uninstalled => Odinstalowano
#@language pt-br
adi_textpack_fail => A instalação do Textpack falhou
adi_textpack_feedback => Textpack feedback
adi_textpack_online => Textpack também disponível online
#@language ru
adi_install_fail => Не удается установить
adi_installed => Установлено
adi_not_installed => не установлено
adi_textpack_fail => Установка Textpack не завершилась
adi_textpack_feedback => Обратная связь о Textpack
adi_textpack_online => Textpack также доступен онлайн
adi_uninstall => Удалить
adi_uninstall_fail => Не удается удалить
adi_uninstalled => Удалено
#@language sv
adi_install_fail => Kan inte installera
adi_installed => Installerad
adi_not_installed => Inte installerad
adi_textpack_fail => Textpack-installation misslyckades
adi_textpack_feedback => Textpack-återkoppling
adi_textpack_online => Textpack finns även tillgängligt online
adi_uninstall => Avinstallera
adi_uninstall_fail => Kan inte installera
adi_uninstalled => Avinstallerad
adi_upgrade_fail => Går inte att uppgradera
adi_upgrade_required => Uppgradering krävs
adi_upgraded => Uppgraderad
############################
######## adi_matrix ########
############################
#@adi_matrix
#@language en, en-gb, en-us, en-ca
adi_article_data => Article Data
adi_article_matrix => Article Matrix
adi_article_highlighting => Article title highlighting
adi_article_limit => Maximum number of articles
adi_articles_not_modified => No articles modified
adi_article_selection => Article Selection
adi_article_tooltips => Article title tooltips
adi_article_update_fail => Article update failed
adi_articles_saved => Articles saved
adi_custom_condition => Custom condition
adi_include_descendent_cats => Include descendent categories
adi_expiry => Expiry
adi_matrix => Matrix
adi_matrix_admin => Article Matrix Admin
adi_matrix_total_articles => Total articles in matrix:
adi_matrix_cfs_modified => Custom field list modified
adi_matrix_delete_fail => Matrix delete failed
adi_matrix_deleted => Matrix deleted
adi_matrix_input_field_tooltips => Input field tooltips
adi_matrix_validation_error => Validation errors
adi_matrix_name => Matrix name
adi_matrix_update_fail => Matrix settings update failed
adi_matrix_updated => Matrix settings updated
adi_update_matrix => Update matrix settings
#@language de
adi_article_data => Artikeldaten
adi_article_highlighting => Artikeltitel hervorheben
adi_article_limit => Maximale Artikelanzahl
adi_article_selection => Artikelauswahl
adi_article_tooltips => Artikeltitel Tooltips
adi_article_update_fail => Artikelaktualisierung fehlgeschlagen
adi_articles_saved => Artikel gesichert
adi_matrix => Matrix
adi_matrix_delete_fail => Löschen der Matrix fehlgeschlagen
adi_matrix_deleted => Matrix gelöscht
adi_matrix_name => Name der Matrix
adi_matrix_update_fail => Aktualisierung der Matrix-Einstellungen fehlgeschlagen
adi_matrix_updated => Matrix-Einstellungen aktualisiert
adi_update_matrix => Matrix-Einstellungen aktualisieren
#@language es
adi_article_data => Datos del artículo
adi_article_highlighting => Resaltado del título del artículo
adi_article_limit => Máximo número de artículos
adi_article_matrix => Artículo Matrix
adi_article_selection => Selección de artículo
adi_article_tooltips => Tooltips en título de artículos
adi_article_update_fail => Fallo al actualizar el artículo
adi_articles_not_modified => No hubo artículos modificados
adi_articles_saved => Artículos guardados
adi_include_descendent_cats => Incluir categorías descendentes
adi_matrix => Matriz
adi_matrix_admin => Administrador de Artículos Matrix
adi_matrix_cfs_modified => Lista de campo personalizado modificado
adi_matrix_delete_fail => Fallo al intentar borrar la matriz
adi_matrix_deleted => Matriz borrada
adi_matrix_input_field_tooltips => Tooltips sobre campo personalizado
adi_matrix_name => Nombre de matriz
adi_matrix_update_fail => Fallo al intentar actualizar los ajustes de la matriz
adi_matrix_updated => Ajustes de la matriz actualizados
adi_matrix_validation_error => Campos no válidos ignorados
adi_update_matrix => Ajustes de actualización de matriz
#@language fr
adi_article_data => Données de l'article
adi_article_highlighting => Mise en évidence du titre de l'article
adi_article_limit => Nombre maximum d'articles
adi_article_matrix => Matrice d'article
adi_article_selection => Choix de l'article
adi_article_tooltips => Infobulle sur le titre de l'article
adi_article_update_fail => La mise à jour de l'article a échoué
adi_articles_not_modified => Aucun article n'a été modifié
adi_articles_saved => Article sauvegardé
adi_custom_condition => Condition personnalisée
adi_expiry => Expiration
adi_include_descendent_cats => Inclure les catégories descendantes
adi_matrix => Matrice
adi_matrix_admin => Gestionnaire des matrices d'article
adi_matrix_cfs_modified => Liste des champs personnalisés modifiée
adi_matrix_delete_fail => La suppression de la matrice a échoué
adi_matrix_deleted => Matrice supprimée
adi_matrix_input_field_tooltips => Infos-bulle sur les champs de saisie
adi_matrix_name => Nom de la matrice
adi_matrix_total_articles => Nombre d'articles dans la matrice :
adi_matrix_update_fail => La mise à jour des paramètres de la matrice a échoué
adi_matrix_updated => Les paramètres de la matrice ont été mis à jour
adi_matrix_validation_error => Les champs invalides ont été ignorés
adi_update_matrix => Mettre à jour les paramètres de la matrice
#@language it
adi_article_data => Campi degli articoli
adi_article_highlighting => Evidenziatura per gli articoli
adi_article_limit => Limite articolo
adi_article_selection => Selezione articoli
adi_article_tooltips => Tooltip per gli articoli
adi_article_update_fail => Aggiornamento articoli fallito
adi_articles_saved => Articoli salvati
adi_matrix => Matrice
adi_matrix_delete_fail => Cancellazione della matrice fallita
adi_matrix_deleted => Matrice cancellata
adi_matrix_name => Nome della matrice
adi_matrix_update_fail => Aggiornamento delle impostazioni delle matrici fallita
adi_matrix_updated => Impostazioni delle matrici aggiornate
adi_update_matrix => Aggiorna impostazioni Matrice
#@language ja
adi_article_data => 記事データ
adi_article_highlighting => 記事タイトルのハイライト
adi_article_limit => 記事の最大数
adi_article_matrix => Matrix記事
adi_article_selection => 記事のセクション
adi_article_tooltips => 記事タイトルのツールチップ
adi_article_update_fail => 記事の更新に失敗しました
adi_articles_not_modified => No articles modified
adi_articles_saved => 記事を保存しました
adi_custom_condition => カスタムした記事の状態
adi_expiry => 記事の公開期限
adi_include_descendent_cats => 子孫カテゴリを含める
adi_matrix_admin => Matrix記事の管理
adi_matrix_cfs_modified => カスタムフィールドリストの更新
adi_matrix_delete_fail => Matrixの削除に失敗しました
adi_matrix_deleted => Matrixを削除しました
adi_matrix_input_field_tooltips => 入力フィールドのツールチップ
adi_matrix_name => Matrixの名前
adi_matrix_total_articles => Matrix内の合計記事数:
adi_matrix_update_fail => Matrix設定の更新に失敗しました
adi_matrix_updated => Matrix設定を更新しました
adi_matrix_validation_error => 検証エラー
adi_update_matrix => 設定の更新
#@language ru
adi_article_data => Данные статьи
adi_article_selection => Выбор статьи
adi_article_update_fail => Статья не обновилась
adi_articles_saved => Статьи сохранены
adi_matrix => Матрица
adi_matrix_name => Название матрицы
adi_matrix_delete_fail => Матрица не удалена
adi_matrix_deleted => Матрица удалена
adi_matrix_update_fail => Настройки матрицы не обновились
adi_matrix_updated => Настройки матрицы обновились
adi_update_matrix => Обновить настройки матрицы
#@language sv
adi_article_data => Artikeldata
adi_article_limit => Maximalt antal artiklar
adi_article_selection => Artikelavdelning
adi_article_update_fail => Artikeluppdatering misslyckades
adi_articles_saved => Artikel sparad
adi_matrix => Matris
adi_matrix_delete_fail => Radering av matris misslyckades
adi_matrix_deleted => Matris raderad
adi_matrix_name => Matrisnamn
adi_matrix_update_fail => Uppdateringar för matrisens inställningar misslyckades
adi_matrix_updated => Matrisinställningar uppdaterade
adi_update_matrix => Uppdatera matrisinställningar
I’ve probably not captured all of the adi_matrix strings for each language, just grabbed a bunch as an example.
If you stick the admin-side
and the plugin-specific strings for all languages into each plugin, they’ll be stored on your behalf with the plugin. Users will then be able to install languages and get the strings installed without you having to offer the ability within your plugin – although you can always do so if you wish, to allow new strings to be installed.
If you do that, I would advise to update your installation routine to install them in two places:
- Update the
textpack
column in the plugin(s) themselves to have the grabbed strings stored for future language changes by admins. - Update each of the installed languages too as you do now. Look at the
L10n/Lang.php
and other lang functions (such asavailable()
) around the patch to see how you can get the current installed / active languages and iterate over them. You can simply load the pack contents (useTextpack/Parser
) and throw the result atinstallTextpack()
which should do the trick.
There are a few strings missing such as edit_preferences
, privileges
, sort
and sort_dir
which presumably came from core before so you’ll need to add specific strings for those yourself.
The only other thing we have to figure out is what happens when plugins are deleted. You don’t want the [admin-side]
strings to go. Maybe we can figure out a way to only delete them when there are no other plugins by the same author (lang string owner) but I’m not sure how robust that’ll be as it’d depend on all strings having the same owner, or all using the same prefix. In an ideal world, it’d be fine but we also have plugins maintained by other authors to contend with.
Currently it’s up to individual plugin lifecycle handlers, so each plugin will need to remove its own strings minus the [admin-side]
ones. We’ll probably have to live with the admin-side ones being left behind in the DB, I guess, unless we can come up with something clever.
Last edited by Bloke (2018-03-18 14:04:48)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline