Skip to content

Commit

Permalink
Fix some installer issues, remove some noise
Browse files Browse the repository at this point in the history
  • Loading branch information
markaspot committed Dec 9, 2023
1 parent 675dc84 commit 5f2590d
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 66 deletions.
117 changes: 73 additions & 44 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion config/sync/markaspot_map.settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ timeline_date_format: 'ddd dd.mm.yy'
timeline_period: P1D
timeline_fps: '15'
nid_selector: 'article '
zoom_initial: '15'
zoom_initial: '10'
center_lat: '40.73'
center_lng: '-73.93'
request_list_path: /requests
Expand Down
2 changes: 1 addition & 1 deletion scripts/georeport-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ RADIUS_IN_DEGREES=$(awk "BEGIN {print ($RADIUS / 111.32)}")

# Retrieve the services list from the server
services_json=$(curl -s -w '\n%{http_code}\n' http://$VIRTUAL_HOST/georeport/v2/services.json)
echo $services_json;
# echo $services_json;
# Check for errors in the response
response_code=$(echo "$services_json" | tail -n 1)
if [ "$response_code" != "200" ]; then
Expand Down
4 changes: 2 additions & 2 deletions scripts/import.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
cd "$(dirname "$0")/.."

# Install and enable required modules
composer require drupal/migrate_tools drupal/migrate_plus drupal/migrate_source_csv --update-no-dev
composer require drupal/migrate_tools drupal/migrate_plus drupal/migrate_source_csv --update-no-dev --quiet

drush en markaspot_default_content -y
drush en migrate_tools migrate_plus migrate_source_csv -y
Expand Down Expand Up @@ -41,4 +41,4 @@ drush cim --source "$source_path" --partial -y

# Disable and uninstall the modules
drush pmu migrate_source_csv migrate_plus migrate_tools markaspot_default_content -y
composer remove drupal/migrate_tools drupal/migrate_plus drupal/migrate_source_csv
composer remove drupal/migrate_tools drupal/migrate_plus drupal/migrate_source_csv --quiet
4 changes: 3 additions & 1 deletion scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
fi

printf "\e[32mInstall all libraries with composer..\e[0m\n"
composer install --no-dev
composer install --no-dev --quiet


if [ "$ENVIRONMENT" != "prod" ]; then
Expand Down Expand Up @@ -119,6 +119,8 @@ if [ "$ENVIRONMENT" != "prod" ]; then
read city_name
echo "Please enter the country name:"
read country_name
echo "Please enter the locale (format as 'language_country', e.g. 'en_US'):"
read locale

if ! get_city_info "$city_name" "$country_name"; then
echo "City not found or not entered. Please enter the latitude:"
Expand Down
44 changes: 27 additions & 17 deletions scripts/translate.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,43 @@
#!/bin/sh

if [ -z "$1" ]
then
# Default to German if no language is supplied
if [ -z "$1" ]; then
echo "No language supplied, defaulting to German (de)"
language="de"
else
else
language="$1"
fi

# Determine the Drupal version
drupal_version=$(drush status drupal-version --format=string)
if [ -z "$drupal_version" ]; then
echo "Error: Unable to determine Drupal version."
exit 1
fi

printf "\e[36mImporting translation for $language...\e[0m\n"
drush language-add $language

# Download .po file
printf "\e[36mDownloading .po file...\e[0m\n"
wget "https://ftp.drupal.org/files/translations/10.x/drupal/drupal-$language.po" -P ../translations

# Import .po file
drush locale:import $language ../translations/drupal-$language.po
# Check if the .po file was downloaded successfully
if [ -f "$translations_dir/drupal-$drupal_version.$language.po" ]; then

# Set the working directory to the script's parent directory
cd "$(dirname "$0")/.."
# Set the working directory to the script's parent directory
cd "$(dirname "$0")/.."

# Set configuration for the language
drush config:set language.types negotiation.language_interface.enabled.$language 1 -y
drush config:set language.types negotiation.language_interface.method_id language-browser -y
drush config:set language.administration negotiation.language_administration_language $language -y
drush user:modify 1 --langcode=$language

drush config:set language.types negotiation.language_interface.enabled.$language 1 -y
drush config:set language.types negotiation.language_interface.method_id language-browser -y
drush config:set system.site default_langcode $language -y
drush config:set system.site default_langcode $language -y

# Enable multilingual support
printf "\e[36mEnabling translatable Taxonomy Terms for multilingual Georeport Services...\e[0m\n"
drush en markaspot_language
drush cr

# Enable multilingual support
printf "\e[36mEnabling translatable Taxonmy Terms for multilingual Georeport Services...\e[0m\n"
drush en markaspot_language
drush cr
else
echo "Error: .po file not found. Download failed or incorrect language code."
fi

0 comments on commit 5f2590d

Please sign in to comment.