Skip to content

Commit

Permalink
Merge branch 'main' into 458-punctuation-check
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfheij-sil committed Dec 17, 2024
2 parents 7899334 + 7de6701 commit 2dc5c03
Show file tree
Hide file tree
Showing 179 changed files with 14,963 additions and 11,010 deletions.
11 changes: 11 additions & 0 deletions .stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,22 @@ module.exports = {
},
],
rules: {
// Disable Stylelint's indentation control
'@stylistic/indentation': null,
// Let Prettier handle selector list formatting
'@stylistic/selector-list-comma-newline-after': null,
'color-named': null,
'max-nesting-depth': 2,
'no-descending-specificity': null,
'selector-max-compound-selectors': 4,
'selector-max-id': 1,
'at-rule-no-unknown': null,
'scss/at-rule-no-unknown': [
true,
{
ignoreAtRules: ['tailwind', 'apply', 'layer', 'screen', 'variants'],
},
],
},
};

Expand Down
20 changes: 11 additions & 9 deletions assets/localization/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
"%about_db_ip_attribution_format%": "{intro} {websiteLink} ({license}, {terms})",
"%about_db_ip_attribution_intro%": "Internet safety features use data from",
"%about_db_ip_attribution_terms%": "Terms",
"%downloadResources_errorRegistrationInvalid%": "User registration is not valid. Cannot retrieve resources from DBL.",
"%downloadResources_errorInstallResource_resourceNotFound%": "Resource not available from DBL",
"%downloadResources_errorInstallResource_resourceAlreadyInstalled%": "Resource is already installed and up to date. Installation skipped.",
"%downloadResources_errorInstallResource_installationFailed%": "Resource cannot be found after attempted installation. Installation failed.",
"%downloadResources_errorUninstallResource_resourceNotFound%": "Resource not found on list of DBL resources.",
"%downloadResources_errorUninstallResource_resourceNotInstalled%": "Resource is not currently installed, so it can't be removed.",
"%downloadResources_errorUninstallResource_localResourceNotFound%": "Resource cannot be located, so it can't be removed.",
"%downloadResources_errorUninstallResource_localResourceStillPresent%": "Resource is still present. Removing failed.",
"%downloadUpdateProjectTab_aria_downloadable%": "downloadable projects",
"%downloadUpdateProjectTab_aria_downloaded%": "downloaded projects",
"%downloadUpdateProjectTab_button_delete%": "Delete",
Expand All @@ -20,6 +12,14 @@
"%downloadUpdateProjectTab_title_downloadUpdate%": "Download/Update Project",
"%general_button_submit%": "Submit",
"%general_cancel%": "Cancel",
"%getResources_errorRegistrationInvalid%": "User registration is not valid. Cannot retrieve resources from DBL.",
"%getResources_errorInstallResource_resourceNotFound%": "Resource not available from DBL",
"%getResources_errorInstallResource_resourceAlreadyInstalled%": "Resource is already installed and up to date. Installation skipped.",
"%getResources_errorInstallResource_installationFailed%": "Resource cannot be found after attempted installation. Installation failed.",
"%getResources_errorUninstallResource_resourceNotFound%": "Resource not found on list of DBL resources.",
"%getResources_errorUninstallResource_resourceNotInstalled%": "Resource is not currently installed, so it can't be removed.",
"%getResources_errorUninstallResource_localResourceNotFound%": "Resource cannot be located, so it can't be removed.",
"%getResources_errorUninstallResource_localResourceStillPresent%": "Resource is still present. Removing failed.",
"%insertNote%": "Insert Note",
"%general_error_title%": "Error",
"%general_loading%": "Loading",
Expand All @@ -29,6 +29,7 @@
"%mainMenu_about%": "About Platform.Bible",
"%mainMenu_downloadInstallResources%": "Download/Install Resources",
"%mainMenu_exit%": "Exit",
"%mainMenu_openDeveloperDocumentation%": "Open Developer Documentation",
"%mainMenu_openProject%": "Open Project",
"%mainMenu_settings%": "Settings",
"%mainMenu_visitSupportBible%": "Visit Support.Bible",
Expand Down Expand Up @@ -64,6 +65,7 @@
"%settings_sidebar_projectsLabel%": "Projects",
"%settings_title_projectSettings%": "Project Settings",
"%settings_title%": "Settings",
"%settings_uiLanguageSelector_selectFallbackLanguages%": "Select Fallback Language",
"%submitButton%": "Submit",
"%scrollGroup_undefined%": "Ø",
"%scrollGroup_0%": "A",
Expand All @@ -86,7 +88,7 @@
"%settings_platform_verseRef_label%": "Current Verse Reference for Scroll Group A (Deprecated)",
"%settings_platform_verseRef_description%": "Current Verse Reference for Scroll Group A. Deprecated - please use `papi.scrollGroups` and `useWebViewScrollGroupScrRef`",
"%settings_platform_interfaceLanguage_label%": "Interface Language",
"%settings_platform_interfaceLanguage_description%": "List of locales to use when localizing the interface. First in the list receives highest priority. 'en' (English) is always added at the end, so everything localizes to English if it does not have a localization in a higher-priority locale.",
"%settings_platform_interfaceLanguage_description%": "Primary and any explicitly chosen fallback locales to use when localizing the interface. 'en' (English) is always the ultimate fallback if there is not a localization in a higher-priority locale.",
"%settings_platform_ptxUtilsMementoData_label%": "PtxUtils Memento Data",
"%settings_platform_paratextDataLastRegistryDataCachedTimes_label%": "ParatextData Last Registry Data Cached Times",
"%settings_platform_comments_enabled_label%": "Comments enabled (experimental)",
Expand Down
4 changes: 3 additions & 1 deletion assets/localization/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
"%mainMenu_exit%": "Salir",
"%mainMenu_help%": "Ayuda",
"%mainMenu_layout%": "Diseño",
"%mainMenu_openDeveloperDocumentation%": "Abrir documentación para desarrolladores",
"%mainMenu_openProject%": "Abrir proyecto",
"%mainMenu_project%": "Proyecto",
"%mainMenu_settings%": "Configuración",
Expand Down Expand Up @@ -174,7 +175,7 @@
"%settings_defaultSearchText_searchUserSettings%": "Buscar Configuración del Usuario...",
"%settings_platform_group1_description%": "Configuraciones generales del software fundamental",
"%settings_platform_group1_label%": "Configuración de la Plataforma",
"%settings_platform_interfaceLanguage_description%": "Lista de locales usados al localizar la interfaz en orden descendente de prioridad. 'en' (inglés) siempre se añade al final, de modo que si no se encuentra una traducción en ninguno de los idiomas especificados, aparecerá en inglés.",
"%settings_platform_interfaceLanguage_description%": "El idioma principal de interfaz, más cualquier selección de idiomas adicionales que sirven como respaldo al localizar la interfaz. 'en' (inglés) siempre es el último idioma de respaldo de modo que si no se encuentra una traducción en ninguno de los idiomas especificados, aparecerá en inglés.",
"%settings_platform_label_group1%": "Configuraciones de Platform",
"%settings_platform_interfaceLanguage_label%": "Idioma de interfaz",
"%settings_platform_paratextDataLastRegistryDataCachedTimes_label%": "ParatextData Últimos Datos del Registro Almacenados en Caché",
Expand All @@ -183,6 +184,7 @@
"%settings_platform_verseRef_label%": "Referencia de Verso Actual para el Grupo de Desplazamiento A (Obsoleto)",
"%settings_title_projectSettings%": "Configuración del Proyecto",
"%settings_title%": "Configuración",
"%settings_uiLanguageSelector_selectFallbackLanguages%": "Selecionar Idioma de respaldo de Interfaz",
"%some_localization_key%": "Esto es el texto en español para %some_localization_key%.",
"%submitButton%": "Enviar",
"%tab_aria_tab%": "Pestaña",
Expand Down
2 changes: 1 addition & 1 deletion c-sharp/JsonUtils/VerseRefConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ JsonSerializerOptions options
bookName,
chapterNum.Value.ToString(),
verse ?? verseNum!.Value.ToString(),
new ScrVers(versification)
string.IsNullOrEmpty(versification) ? null : new ScrVers(versification)
);
}

Expand Down
14 changes: 7 additions & 7 deletions c-sharp/Program.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System.Diagnostics;
using Paranext.DataProvider.Checks;
using Paranext.DataProvider.NetworkObjects;
using Paranext.DataProvider.Projects;
Expand All @@ -16,13 +17,12 @@ public static async Task Main()
Console.WriteLine("Paranext data provider starting up");
Thread.CurrentThread.Name = "Main";

// Turn on additional logging to help diagnose failures on macOS
if (OperatingSystem.IsMacOS())
{
System.Diagnostics.Trace.Listeners.Add(new System.Diagnostics.ConsoleTraceListener());
System.Diagnostics.Trace.AutoFlush = true;
System.Diagnostics.Trace.WriteLine("Trace logging enabled");
}
var listener = new ConsoleTraceListener { TraceOutputOptions = TraceOptions.DateTime };
// Clear the default listeners to stop Debug.Assert from crashing the app
Trace.Listeners.Clear();
// Log all trace messages to the console
Trace.Listeners.Add(listener);
Trace.AutoFlush = true;

using PapiClient papi = new();
try
Expand Down
20 changes: 10 additions & 10 deletions c-sharp/Projects/DigitalBibleLibrary/DblDownloadableDataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Paranext.DataProvider.Projects.DigitalBibleLibrary;
/// Data provider that can install, update and uninstall DBL (Digital Bible Library) resources
/// </summary>
internal class DblResourcesDataProvider(PapiClient papiClient)
: NetworkObjects.DataProvider("paratextBibleDownloadResources.dblResourcesProvider", papiClient)
: NetworkObjects.DataProvider("platformGetResources.dblResourcesProvider", papiClient)
{
#region Internal classes

Expand All @@ -30,7 +30,7 @@ string ProjectId
public string DisplayName { get; set; } = DisplayName;
public string FullName { get; set; } = FullName;
public string BestLanguageName { get; set; } = BestLanguageName;
public string Type { get; set; } = Type.ToString();
public string Type { get; set; } = Type.ToString() + "Resource";
public long Size { get; set; } = Size;
public bool Installed { get; set; } = Installed;
public bool UpdateAvailable { get; set; } = UpdateAvailable;
Expand Down Expand Up @@ -101,7 +101,7 @@ private List<DblResourceData> GetDblResources(JsonElement _ignore)
throw new Exception(
LocalizationService.GetLocalizedString(
PapiClient,
"%downloadResources_errorRegistrationInvalid%",
"%getResources_errorRegistrationInvalid%",
$"User registration is not valid. Cannot retrieve resources from DBL."
)
);
Expand Down Expand Up @@ -146,7 +146,7 @@ private void InstallDblResource(string DBLEntryUid)
DBLEntryUid,
LocalizationService.GetLocalizedString(
PapiClient,
"%downloadResources_errorInstallResource_resourceNotFound%",
"%getResources_errorInstallResource_resourceNotFound%",
$"Resource not available from DBL."
),
out var installableResource
Expand All @@ -156,7 +156,7 @@ out var installableResource
throw new Exception(
LocalizationService.GetLocalizedString(
PapiClient,
"%downloadResources_errorInstallResource_resourceAlreadyInstalled%",
"%getResources_errorInstallResource_resourceAlreadyInstalled%",
$"Resource is already installed and up to date. Installation skipped."
)
);
Expand All @@ -170,7 +170,7 @@ out var installableResource
throw new Exception(
LocalizationService.GetLocalizedString(
PapiClient,
"%downloadResources_errorInstallResource_installationFailed%",
"%getResources_errorInstallResource_installationFailed%",
$"Resource cannot be found after attempted installation. Installation failed."
)
);
Expand All @@ -187,7 +187,7 @@ private void UninstallDblResource(string DBLEntryUid)
DBLEntryUid,
LocalizationService.GetLocalizedString(
PapiClient,
"%downloadResources_errorUninstallResource_resourceNotFound%",
"%getResources_errorUninstallResource_resourceNotFound%",
$"Resource not found on list of DBL resources."
),
out var installableResource
Expand All @@ -197,7 +197,7 @@ out var installableResource
throw new Exception(
LocalizationService.GetLocalizedString(
PapiClient,
"%downloadResources_errorUninstallResource_resourceNotInstalled%",
"%getResources_errorUninstallResource_resourceNotInstalled%",
$"Resource is not currently installed, so it can't be removed."
)
);
Expand All @@ -209,7 +209,7 @@ out var installableResource
throw new Exception(
LocalizationService.GetLocalizedString(
PapiClient,
"%downloadResources_errorUninstallResource_localResourceNotFound%",
"%getResources_errorUninstallResource_localResourceNotFound%",
$"Resource cannot be located, so it can't be removed."
)
);
Expand All @@ -224,7 +224,7 @@ out var installableResource
throw new Exception(
LocalizationService.GetLocalizedString(
PapiClient,
"%downloadResources_errorUninstallResource_localResourceStillPresent%",
"%getResources_errorUninstallResource_localResourceStillPresent%",
$"Resource is still present. Removing failed."
)
);
Expand Down
2 changes: 2 additions & 0 deletions c-sharp/Projects/ParatextProjectDataProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@ Func<ScrText, VerseRef, string> getTextFromScrText
try
{
var scrText = LocalParatextProjects.GetParatextProject(ProjectDetails.Metadata.Id);
if (verseRef.Versification == null)
verseRef.Versification = scrText.Settings.Versification;
return getTextFromScrText(scrText, verseRef);
}
catch (Exception e) when (e is ArgumentException or ProjectNotFoundException)
Expand Down
2 changes: 2 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"appdata",
"asyncs",
"autodocs",
"autonym",
"bbbcccvvv",
"biblionexus",
"camelcase",
Expand Down Expand Up @@ -60,6 +61,7 @@
"newtonsoft",
"nodebuffer",
"nums",
"openrpc",
"papi",
"papis",
"paranext",
Expand Down
7 changes: 7 additions & 0 deletions extensions/.stylelintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ module.exports = {
'no-descending-specificity': null,
'selector-max-compound-selectors': 4,
'selector-max-id': 1,
'at-rule-no-unknown': null,
'scss/at-rule-no-unknown': [
true,
{
ignoreAtRules: ['tailwind', 'apply', 'layer', 'screen', 'variants'],
},
],
},
};

Expand Down
4 changes: 2 additions & 2 deletions extensions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ Platform.Bible WebViews must be treated differently than other code, so this pro

### Built-in Tailwind CSS support

This project is equipped with [Tailwind CSS](https://tailwindcss.com/) configured the same way it is configured in Platform.Bible's React component library `platform-bible-react` to enable WebViews to match Platform.Bible's look and feel. To add Tailwind CSS to your WebView, simply import your extension's `./src/tailwind.css` file into your WebView's style `.scss` file (note that you should not add the `.css` extension when importing local CSS files into `.scss` files):
This project is equipped with [Tailwind CSS](https://tailwindcss.com/) configured the same way it is configured in Platform.Bible's React component library `platform-bible-react` to enable WebViews to match Platform.Bible's look and feel. To add Tailwind CSS to your WebView, simply use your extension's `./src/tailwind.css` file in your WebView's style `.scss` file (note that you should not add the `.css` extension when using local CSS files into `.scss` files):

```scss
@import './path/to/src/tailwind';
@use './path/to/src/tailwind';
```

Adding this import to your WebView's styles enables Tailwind CSS in the WebView. Alternatively, you can directly use `./src/tailwind.css` as your WebView's style file if you do not need any additional CSS. Important Tailwind configuration notes:
Expand Down
30 changes: 15 additions & 15 deletions extensions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,43 +48,43 @@
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.0",
"@mui/material": "^5.15.10",
"@swc/core": "^1.7.35",
"@swc/core": "^1.10.1",
"@tailwindcss/typography": "^0.5.15",
"@types/node": "^20.16.11",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@types/node": "^20.17.10",
"@types/react": "^18.3.16",
"@types/react-dom": "^18.3.5",
"@types/webpack": "^5.28.5",
"@typescript-eslint/parser": "^6.21.0",
"autoprefixer": "^10.4.20",
"concurrently": "^9.0.1",
"concurrently": "^9.1.0",
"copy-webpack-plugin": "^12.0.2",
"cross-env": "^7.0.3",
"css-loader": "^6.11.0",
"escape-string-regexp": "^5.0.0",
"glob": "^10.4.5",
"lucide-react": "^0.452.0",
"lucide-react": "^0.468.0",
"papi-dts": "file:../lib/papi-dts",
"platform-bible-react": "file:../lib/platform-bible-react",
"postcss": "^8.4.47",
"postcss": "^8.4.49",
"postcss-loader": "^8.1.1",
"prettier": "^3.3.3",
"prettier": "^3.4.2",
"prettier-plugin-jsdoc": "^1.3.0",
"replace-in-file": "^7.2.0",
"sass": "^1.79.5",
"sass-loader": "^16.0.2",
"stylelint": "^16.10.0",
"sass": "^1.83.0",
"sass-loader": "^16.0.4",
"stylelint": "^16.11.0",
"stylelint-config-recommended": "^14.0.1",
"stylelint-config-sass-guidelines": "^12.1.0",
"stylelint-config-tailwindcss": "^0.0.7",
"swc-loader": "^0.2.6",
"tailwindcss": "^3.4.13",
"tailwindcss": "^3.4.16",
"tailwindcss-animate": "^1.0.7",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"tsconfig-paths-webpack-plugin": "^4.1.0",
"tsx": "^4.19.1",
"tsconfig-paths-webpack-plugin": "^4.2.0",
"tsx": "^4.19.2",
"typescript": "^5.4.5",
"webpack": "^5.95.0",
"webpack": "^5.97.1",
"webpack-cli": "^5.1.4",
"webpack-merge": "^6.0.1",
"zip-folder-promise": "^1.2.0"
Expand Down
7 changes: 7 additions & 0 deletions extensions/src/hello-someone/.stylelintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ module.exports = {
'no-descending-specificity': null,
'selector-max-compound-selectors': 4,
'selector-max-id': 1,
'at-rule-no-unknown': null,
'scss/at-rule-no-unknown': [
true,
{
ignoreAtRules: ['tailwind', 'apply', 'layer', 'screen', 'variants'],
},
],
},
};

Expand Down
Loading

0 comments on commit 2dc5c03

Please sign in to comment.