diff --git a/.gitignore b/.gitignore index f02a819..d1b5863 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,7 @@ /cache/ /dependencies/ /build/ +*~ +*.org +#*# +*.mo diff --git a/README.md b/README.md index 0f7ee77..f1e4b5b 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,31 @@ A level can consist of multiple repositories. To have more than one, you can use At this stage, we're still exploring ourselves which kind of levels would be fun! So feel free to try new things: basic introductions with a little story? Really hard puzzles? Levels where you have to find information? Levels where you need to fix a problem? Levels with three remotes? +## Add localizations +1. Add the localization text into the section "description" in the file ./resource/cards.json +``` +Example: +"description": { + "en_EN": "Drag this card into the empty space above to initialize the time machine!", + "it_IT": "Trascina questa carta nell'area vuota sopra per inizializzare la macchina del tempo", + "es_ES": "Arrastre esta tarjeta al área en blanco de arriba para inicializar la máquina del tiempo" +} +``` +2. Add, into the directory **levels**, the directory with the levels do you want to adding (es. ./levels/fr_FR/LIVELLI ) +3. Add, the localization into the dictionary game.langs (es. `var langs = {0: "en_EN", 1: "it_IT", 2: "es_ES"}` the first and default localization it must be en_EN +4. Add column of specific locale and relative traductions for avery keys in the file ./resource/localization.csv +``` +Example: + +keys,en,it,es +LEVELS,Levels,Livelli,niveles +QUIT,Quit,Esci,Salir +BACK,Back,Indietro,Espalda + +``` + +If one or more localizations in the descriptions of cards are missing and levels require that card, the game crashes! + ## Contribute code! To open the game in the [Godot editor](https://godotengine.org), run `godot project.godot`. You can then run the game using *F5*. diff --git a/cards/add.svg.import b/cards/add.svg.import index cca9696..4ec9107 100644 --- a/cards/add.svg.import +++ b/cards/add.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/bisect-bad.svg.import b/cards/bisect-bad.svg.import index c2afba5..a23974f 100644 --- a/cards/bisect-bad.svg.import +++ b/cards/bisect-bad.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/bisect-good.svg.import b/cards/bisect-good.svg.import index 50f3eef..eccfb46 100644 --- a/cards/bisect-good.svg.import +++ b/cards/bisect-good.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/bisect-start.svg.import b/cards/bisect-start.svg.import index cd672e1..f58b103 100644 --- a/cards/bisect-start.svg.import +++ b/cards/bisect-start.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/branch-delete.svg.import b/cards/branch-delete.svg.import index 6277fe4..385e0b9 100644 --- a/cards/branch-delete.svg.import +++ b/cards/branch-delete.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/branch.svg.import b/cards/branch.svg.import index ff2d5b8..f0a165e 100644 --- a/cards/branch.svg.import +++ b/cards/branch.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/checkout-file.svg.import b/cards/checkout-file.svg.import index a960142..10b175c 100644 --- a/cards/checkout-file.svg.import +++ b/cards/checkout-file.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/checkout-from.svg.import b/cards/checkout-from.svg.import index 2892f47..7e6160e 100644 --- a/cards/checkout-from.svg.import +++ b/cards/checkout-from.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/checkout.svg.import b/cards/checkout.svg.import index 895efd6..ba8c88a 100644 --- a/cards/checkout.svg.import +++ b/cards/checkout.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/cherry-pick.svg.import b/cards/cherry-pick.svg.import index 3549183..1c88964 100644 --- a/cards/cherry-pick.svg.import +++ b/cards/cherry-pick.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/clone.svg.import b/cards/clone.svg.import index 1f894b7..6fa25e0 100644 --- a/cards/clone.svg.import +++ b/cards/clone.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/commit-a.svg.import b/cards/commit-a.svg.import index d514e29..be711b0 100644 --- a/cards/commit-a.svg.import +++ b/cards/commit-a.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/commit-auto.svg.import b/cards/commit-auto.svg.import index 51e7cfd..4f561ca 100644 --- a/cards/commit-auto.svg.import +++ b/cards/commit-auto.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/commit.svg.import b/cards/commit.svg.import index 613bc09..1e1535b 100644 --- a/cards/commit.svg.import +++ b/cards/commit.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/fetch.svg.import b/cards/fetch.svg.import index 3c65896..80da734 100644 --- a/cards/fetch.svg.import +++ b/cards/fetch.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/file-copy.svg.import b/cards/file-copy.svg.import index ebd39cb..f5c9405 100644 --- a/cards/file-copy.svg.import +++ b/cards/file-copy.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/file-delete.svg.import b/cards/file-delete.svg.import index 9c9d9da..942334e 100644 --- a/cards/file-delete.svg.import +++ b/cards/file-delete.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/file-new.svg.import b/cards/file-new.svg.import index 968c800..334d7a1 100644 --- a/cards/file-new.svg.import +++ b/cards/file-new.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/file-rename.svg.import b/cards/file-rename.svg.import index 79f1261..ca2d82c 100644 --- a/cards/file-rename.svg.import +++ b/cards/file-rename.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/init.svg.import b/cards/init.svg.import index aacb273..dedbfe6 100644 --- a/cards/init.svg.import +++ b/cards/init.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/merge-abort.svg.import b/cards/merge-abort.svg.import index cbdf0a8..4a919d2 100644 --- a/cards/merge-abort.svg.import +++ b/cards/merge-abort.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/merge.svg.import b/cards/merge.svg.import index b96f40d..a83da3d 100644 --- a/cards/merge.svg.import +++ b/cards/merge.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/pull.svg.import b/cards/pull.svg.import index 15ab40d..e792f8f 100644 --- a/cards/pull.svg.import +++ b/cards/pull.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/push.svg.import b/cards/push.svg.import index aa6a9ff..e191ead 100644 --- a/cards/push.svg.import +++ b/cards/push.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/rebase-continue.svg.import b/cards/rebase-continue.svg.import index 4276f0a..41f5eda 100644 --- a/cards/rebase-continue.svg.import +++ b/cards/rebase-continue.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/rebase-interactive.svg.import b/cards/rebase-interactive.svg.import index a65c315..ebe0624 100644 --- a/cards/rebase-interactive.svg.import +++ b/cards/rebase-interactive.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/rebase.svg.import b/cards/rebase.svg.import index 97241e1..460096a 100644 --- a/cards/rebase.svg.import +++ b/cards/rebase.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/reflog.svg.import b/cards/reflog.svg.import index 17b81f7..00dcf26 100644 --- a/cards/reflog.svg.import +++ b/cards/reflog.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/reset-file.svg.import b/cards/reset-file.svg.import index 883becf..03dc0bd 100644 --- a/cards/reset-file.svg.import +++ b/cards/reset-file.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/reset-hard.svg.import b/cards/reset-hard.svg.import index 199bee3..103b70b 100644 --- a/cards/reset-hard.svg.import +++ b/cards/reset-hard.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/reset.svg.import b/cards/reset.svg.import index 3409230..0e43dc4 100644 --- a/cards/reset.svg.import +++ b/cards/reset.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/revert.svg.import b/cards/revert.svg.import index 6f0bbfc..6491f9c 100644 --- a/cards/revert.svg.import +++ b/cards/revert.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/rm.svg.import b/cards/rm.svg.import index 2830052..ab96873 100644 --- a/cards/rm.svg.import +++ b/cards/rm.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/cards/show.svg.import b/cards/show.svg.import index 39cebac..40f1504 100644 --- a/cards/show.svg.import +++ b/cards/show.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/export_presets.cfg b/export_presets.cfg index 99aaf85..4084d47 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -7,22 +7,21 @@ custom_features="" export_filter="all_resources" include_filter="levels/*, scripts/*, resources/*, cards/*" exclude_filter="dependencies/*, cache/*" -export_path="" -patch_list=PoolStringArray( ) +export_path="../../../Downloads/Oh My Git!.x86_64" script_export_mode=1 script_encryption_key="" [preset.0.options] +custom_template/debug="" +custom_template/release="" +binary_format/64_bits=true +binary_format/embed_pck=false texture_format/bptc=false texture_format/s3tc=true texture_format/etc=false texture_format/etc2=false texture_format/no_bptc_fallbacks=true -binary_format/64_bits=true -binary_format/embed_pck=false -custom_template/release="" -custom_template/debug="" [preset.1] @@ -34,7 +33,6 @@ export_filter="all_resources" include_filter="levels/*, scripts/*, resources/*, cards/*" exclude_filter="dependencies/*, cache/*" export_path="" -patch_list=PoolStringArray( ) script_export_mode=1 script_encryption_key="" @@ -47,12 +45,54 @@ application/info="" application/icon="" application/identifier="" application/signature="" +application/app_category="Games" application/short_version="1.0" application/version="1.0" application/copyright="" display/high_res=false -privacy/camera_usage_description="" privacy/microphone_usage_description="" +privacy/camera_usage_description="" +privacy/location_usage_description="" +privacy/address_book_usage_description="" +privacy/calendar_usage_description="" +privacy/photos_library_usage_description="" +privacy/desktop_folder_usage_description="" +privacy/documents_folder_usage_description="" +privacy/downloads_folder_usage_description="" +privacy/network_volumes_usage_description="" +privacy/removable_volumes_usage_description="" +codesign/enable=true +codesign/identity="" +codesign/timestamp=true +codesign/hardened_runtime=true +codesign/replace_existing_signature=true +codesign/entitlements/custom_file="" +codesign/entitlements/allow_jit_code_execution=false +codesign/entitlements/allow_unsigned_executable_memory=false +codesign/entitlements/allow_dyld_environment_variables=false +codesign/entitlements/disable_library_validation=false +codesign/entitlements/audio_input=false +codesign/entitlements/camera=false +codesign/entitlements/location=false +codesign/entitlements/address_book=false +codesign/entitlements/calendars=false +codesign/entitlements/photos_library=false +codesign/entitlements/apple_events=false +codesign/entitlements/debugging=false +codesign/entitlements/app_sandbox/enabled=false +codesign/entitlements/app_sandbox/network_server=false +codesign/entitlements/app_sandbox/network_client=false +codesign/entitlements/app_sandbox/device_usb=false +codesign/entitlements/app_sandbox/device_bluetooth=false +codesign/entitlements/app_sandbox/files_downloads=0 +codesign/entitlements/app_sandbox/files_pictures=0 +codesign/entitlements/app_sandbox/files_music=0 +codesign/entitlements/app_sandbox/files_movies=0 +codesign/custom_options=PoolStringArray( ) +notarization/enable=false +notarization/apple_id_name="" +notarization/apple_id_password="" +notarization/apple_team_id="" texture_format/s3tc=true texture_format/etc=false texture_format/etc2=false @@ -66,23 +106,23 @@ custom_features="" export_filter="all_resources" include_filter="levels/*, scripts/*, resources/*, cards/*" exclude_filter="dependencies/*, cache/*" -export_path="" -patch_list=PoolStringArray( ) +export_path="../../../Downloads/Oh My Git!.exe" script_export_mode=1 script_encryption_key="" [preset.2.options] +custom_template/debug="" +custom_template/release="" +binary_format/64_bits=true +binary_format/embed_pck=false texture_format/bptc=false texture_format/s3tc=true texture_format/etc=false texture_format/etc2=false texture_format/no_bptc_fallbacks=true -binary_format/64_bits=true -binary_format/embed_pck=false -custom_template/release="" -custom_template/debug="" codesign/enable=false +codesign/identity_type=0 codesign/identity="" codesign/password="" codesign/timestamp=true @@ -90,6 +130,7 @@ codesign/timestamp_server_url="" codesign/digest_algorithm=1 codesign/description="" codesign/custom_options=PoolStringArray( ) +application/modify_resources=true application/icon="" application/file_version="" application/product_version="" @@ -109,15 +150,233 @@ export_filter="all_resources" include_filter="levels/*, scripts/*, resources/*" exclude_filter="dependencies/*, cache/*" export_path="" -patch_list=PoolStringArray( ) script_export_mode=1 script_encryption_key="" [preset.3.options] +custom_template/debug="" +custom_template/release="" +variant/export_type=0 vram_texture_compression/for_desktop=true vram_texture_compression/for_mobile=false +html/export_icon=true html/custom_html_shell="" html/head_include="" -custom_template/release="" +html/canvas_resize_policy=2 +html/focus_canvas_on_start=true +html/experimental_virtual_keyboard=false +progressive_web_app/enabled=false +progressive_web_app/offline_page="" +progressive_web_app/display=1 +progressive_web_app/orientation=0 +progressive_web_app/icon_144x144="" +progressive_web_app/icon_180x180="" +progressive_web_app/icon_512x512="" +progressive_web_app/background_color=Color( 0, 0, 0, 1 ) + +[preset.4] + +name="Android" +platform="Android" +runnable=true +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="" +script_export_mode=1 +script_encryption_key="" + +[preset.4.options] + custom_template/debug="" +custom_template/release="" +custom_build/use_custom_build=false +custom_build/export_format=0 +custom_build/min_sdk="" +custom_build/target_sdk="" +architectures/armeabi-v7a=true +architectures/arm64-v8a=true +architectures/x86=false +architectures/x86_64=false +keystore/debug="" +keystore/debug_user="" +keystore/debug_password="" +keystore/release="" +keystore/release_user="" +keystore/release_password="" +one_click_deploy/clear_previous_install=false +version/code=1 +version/name="1.0" +package/unique_name="org.godotengine.$genname" +package/name="" +package/signed=true +package/classify_as_game=true +package/retain_data_on_uninstall=false +package/exclude_from_recents=false +launcher_icons/main_192x192="" +launcher_icons/adaptive_foreground_432x432="" +launcher_icons/adaptive_background_432x432="" +graphics/opengl_debug=false +xr_features/xr_mode=0 +xr_features/hand_tracking=0 +xr_features/hand_tracking_frequency=0 +xr_features/passthrough=0 +screen/immersive_mode=true +screen/support_small=true +screen/support_normal=true +screen/support_large=true +screen/support_xlarge=true +user_data_backup/allow=false +command_line/extra_args="" +apk_expansion/enable=false +apk_expansion/SALT="" +apk_expansion/public_key="" +permissions/custom_permissions=PoolStringArray( ) +permissions/access_checkin_properties=false +permissions/access_coarse_location=false +permissions/access_fine_location=false +permissions/access_location_extra_commands=false +permissions/access_mock_location=false +permissions/access_network_state=false +permissions/access_surface_flinger=false +permissions/access_wifi_state=false +permissions/account_manager=false +permissions/add_voicemail=false +permissions/authenticate_accounts=false +permissions/battery_stats=false +permissions/bind_accessibility_service=false +permissions/bind_appwidget=false +permissions/bind_device_admin=false +permissions/bind_input_method=false +permissions/bind_nfc_service=false +permissions/bind_notification_listener_service=false +permissions/bind_print_service=false +permissions/bind_remoteviews=false +permissions/bind_text_service=false +permissions/bind_vpn_service=false +permissions/bind_wallpaper=false +permissions/bluetooth=false +permissions/bluetooth_admin=false +permissions/bluetooth_privileged=false +permissions/brick=false +permissions/broadcast_package_removed=false +permissions/broadcast_sms=false +permissions/broadcast_sticky=false +permissions/broadcast_wap_push=false +permissions/call_phone=false +permissions/call_privileged=false +permissions/camera=false +permissions/capture_audio_output=false +permissions/capture_secure_video_output=false +permissions/capture_video_output=false +permissions/change_component_enabled_state=false +permissions/change_configuration=false +permissions/change_network_state=false +permissions/change_wifi_multicast_state=false +permissions/change_wifi_state=false +permissions/clear_app_cache=false +permissions/clear_app_user_data=false +permissions/control_location_updates=false +permissions/delete_cache_files=false +permissions/delete_packages=false +permissions/device_power=false +permissions/diagnostic=false +permissions/disable_keyguard=false +permissions/dump=false +permissions/expand_status_bar=false +permissions/factory_test=false +permissions/flashlight=false +permissions/force_back=false +permissions/get_accounts=false +permissions/get_package_size=false +permissions/get_tasks=false +permissions/get_top_activity_info=false +permissions/global_search=false +permissions/hardware_test=false +permissions/inject_events=false +permissions/install_location_provider=false +permissions/install_packages=false +permissions/install_shortcut=false +permissions/internal_system_window=false +permissions/internet=false +permissions/kill_background_processes=false +permissions/location_hardware=false +permissions/manage_accounts=false +permissions/manage_app_tokens=false +permissions/manage_documents=false +permissions/manage_external_storage=false +permissions/master_clear=false +permissions/media_content_control=false +permissions/modify_audio_settings=false +permissions/modify_phone_state=false +permissions/mount_format_filesystems=false +permissions/mount_unmount_filesystems=false +permissions/nfc=false +permissions/persistent_activity=false +permissions/process_outgoing_calls=false +permissions/read_calendar=false +permissions/read_call_log=false +permissions/read_contacts=false +permissions/read_external_storage=false +permissions/read_frame_buffer=false +permissions/read_history_bookmarks=false +permissions/read_input_state=false +permissions/read_logs=false +permissions/read_phone_state=false +permissions/read_profile=false +permissions/read_sms=false +permissions/read_social_stream=false +permissions/read_sync_settings=false +permissions/read_sync_stats=false +permissions/read_user_dictionary=false +permissions/reboot=false +permissions/receive_boot_completed=false +permissions/receive_mms=false +permissions/receive_sms=false +permissions/receive_wap_push=false +permissions/record_audio=false +permissions/reorder_tasks=false +permissions/restart_packages=false +permissions/send_respond_via_message=false +permissions/send_sms=false +permissions/set_activity_watcher=false +permissions/set_alarm=false +permissions/set_always_finish=false +permissions/set_animation_scale=false +permissions/set_debug_app=false +permissions/set_orientation=false +permissions/set_pointer_speed=false +permissions/set_preferred_applications=false +permissions/set_process_limit=false +permissions/set_time=false +permissions/set_time_zone=false +permissions/set_wallpaper=false +permissions/set_wallpaper_hints=false +permissions/signal_persistent_processes=false +permissions/status_bar=false +permissions/subscribed_feeds_read=false +permissions/subscribed_feeds_write=false +permissions/system_alert_window=false +permissions/transmit_ir=false +permissions/uninstall_shortcut=false +permissions/update_device_stats=false +permissions/use_credentials=false +permissions/use_sip=false +permissions/vibrate=false +permissions/wake_lock=false +permissions/write_apn_settings=false +permissions/write_calendar=false +permissions/write_call_log=false +permissions/write_contacts=false +permissions/write_external_storage=false +permissions/write_gservices=false +permissions/write_history_bookmarks=false +permissions/write_profile=false +permissions/write_secure_settings=false +permissions/write_settings=false +permissions/write_sms=false +permissions/write_social_stream=false +permissions/write_sync_settings=false +permissions/write_user_dictionary=false diff --git a/images/cli-badge.svg.import b/images/cli-badge.svg.import index 53031f8..930d998 100644 --- a/images/cli-badge.svg.import +++ b/images/cli-badge.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/images/commit.svg.import b/images/commit.svg.import index 54316cf..fbf6f82 100644 --- a/images/commit.svg.import +++ b/images/commit.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/images/conflict.svg.import b/images/conflict.svg.import index 5053a2b..63c961d 100644 --- a/images/conflict.svg.import +++ b/images/conflict.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/images/file.svg.import b/images/file.svg.import index 12aa5dd..49fd863 100644 --- a/images/file.svg.import +++ b/images/file.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/images/head.svg.import b/images/head.svg.import index 2a5c3cf..b92f7aa 100644 --- a/images/head.svg.import +++ b/images/head.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/images/modified.svg.import b/images/modified.svg.import index a7356bb..c8ba6f4 100644 --- a/images/modified.svg.import +++ b/images/modified.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/images/new.svg.import b/images/new.svg.import index 4b01767..1218f0e 100644 --- a/images/new.svg.import +++ b/images/new.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/images/oh-my-git.png.import b/images/oh-my-git.png.import index 708ee15..a173ad8 100644 --- a/images/oh-my-git.png.import +++ b/images/oh-my-git.png.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/images/ref.svg.import b/images/ref.svg.import index 480c664..1b179ae 100644 --- a/images/ref.svg.import +++ b/images/ref.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/images/remote.svg.import b/images/remote.svg.import index 762dceb..7c90ac0 100644 --- a/images/remote.svg.import +++ b/images/remote.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/images/removed.svg.import b/images/removed.svg.import index 1e0dd8a..104b392 100644 --- a/images/removed.svg.import +++ b/images/removed.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/images/settings_32x32.png b/images/settings_32x32.png new file mode 100644 index 0000000..977e052 Binary files /dev/null and b/images/settings_32x32.png differ diff --git a/images/settings_32x32.png.import b/images/settings_32x32.png.import new file mode 100644 index 0000000..c4a7e0c --- /dev/null +++ b/images/settings_32x32.png.import @@ -0,0 +1,35 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/settings_32x32.png-1ec947b33410cb1f2231e893c0d26b43.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://images/settings_32x32.png" +dest_files=[ "res://.import/settings_32x32.png-1ec947b33410cb1f2231e893c0d26b43.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +process/normal_map_invert_y=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/images/string.svg.import b/images/string.svg.import index 97a8d20..53ec0cd 100644 --- a/images/string.svg.import +++ b/images/string.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/images/untracked.svg.import b/images/untracked.svg.import index 95cb700..ab65e26 100644 --- a/images/untracked.svg.import +++ b/images/untracked.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/levels/bisect/bisect b/levels/bisect/en/bisect similarity index 97% rename from levels/bisect/bisect rename to levels/bisect/en/bisect index cf7bf6a..0b66edb 100644 --- a/levels/bisect/bisect +++ b/levels/bisect/en/bisect @@ -9,7 +9,7 @@ Oh no! You have lost your key at some point during the day! Sure, you could look at every single commit in an attempt to find it - but there's a better way: your time machine has a built-in way to find the point in time where things went wrong quickly! -First, play the "bisect start" card. Then, go to a commit where you don't have the key, and play the "bisect bad" card. Likewise, go to a commit early on where you have the key *in your pocket*, and play the "bisect good" card. +First, play the "bisect start" card. Then, go to a commit where you don't have the key, and play the "bisect bad" card. Likewise, go to a commit early on where you have the key *in your pocket*, and play the "bisect good card". After you've found the last good commit, reset the main branch to it. What happened to the key after you lost it? diff --git a/levels/bisect/it/bisect b/levels/bisect/it/bisect new file mode 100644 index 0000000..a80e2e8 --- /dev/null +++ b/levels/bisect/it/bisect @@ -0,0 +1,43 @@ +title = Strada di mattoni gialli +cards = checkout commit-auto reset-hard bisect-start bisect-good bisect-bad + +[description] + +(Perpiacere rimpicciolisci un pochino usando la rotella del mouse! :D) + +Oh no! Hai perso la tua chiave da qualche parte durante il giorno! + +Sicuro, certo potresti guardare in ogni singolo commit nella speranza di trovarlo - ma c'è un modo migliore: la tua macchina del tempo ha un modo integrato per trovare velocemente il punto nel tempo dove le cose sono andate male! + +Per prima cosa, gioca la carta "bisec start". Quindi, vai ad un commit in cui non hai la chiave e gioca la carta "bisect bad". Allo stesso modo vai velocemente in un commit dove hai la chiave *in tascca* e gioca la carta "bisect goofìd". + +Dopo aver trovato l'ultimo commit valido reimposta la branch principale su di esso. Cosa è successo alla chiave dopo che l'hai persa? + +[setup] + +echo "Hai ancora la tua chiave." > you + +for i in {1..30}; do + if test $i -eq 12; then + echo "La tua tasca è vuota." > you + echo "E' per terra." > key + fi + if test $i -eq 13; then + echo "Tiene una chiave nel becco." > bird + rm key + fi + if test $i -eq 14; then + rm bird + fi + git add . + git commit --allow-empty -m "$i" +done + +[win] + +# Trova l'ultimo commit buono +test "$(git log --pretty=%s main | head -1)" -eq 11 + +[congrats] + +Molto bene! :) L'unico problema è che adesso devi tornare a casa camminando, dinuovo... diff --git a/levels/branches/branch-create b/levels/branches/en/branch-create similarity index 100% rename from levels/branches/branch-create rename to levels/branches/en/branch-create diff --git a/levels/branches/branch-remove b/levels/branches/en/branch-remove similarity index 100% rename from levels/branches/branch-remove rename to levels/branches/en/branch-remove diff --git a/levels/branches/checkout-commit b/levels/branches/en/checkout-commit similarity index 100% rename from levels/branches/checkout-commit rename to levels/branches/en/checkout-commit diff --git a/levels/branches/fork b/levels/branches/en/fork similarity index 100% rename from levels/branches/fork rename to levels/branches/en/fork diff --git a/levels/branches/grow b/levels/branches/en/grow similarity index 100% rename from levels/branches/grow rename to levels/branches/en/grow diff --git a/levels/branches/reorder b/levels/branches/en/reorder similarity index 100% rename from levels/branches/reorder rename to levels/branches/en/reorder diff --git a/levels/branches/it/branch-create b/levels/branches/it/branch-create new file mode 100644 index 0000000..2544ead --- /dev/null +++ b/levels/branches/it/branch-create @@ -0,0 +1,44 @@ +title = Creare ramificazioni +cards = checkout commit-auto branch branch-delete reset-hard + +[description] + +Vieni invitato a due feste! In una di queste, suona il tuo gruppo preferito e l'altra è la festa del tuo miglio amico. Dove andrai? Non preoccuparti - come agente del viaggio nel tempo, puoi andare ad entrambe le feste! + +Per rendere più facile dire quale sia la linea temporale, puoi creare portali temporali! (Chiamiamoli "rami-branchs") + +[cli] + +Anche viaggiare tra differenti rami temporali è davvero facile usando la linea di comando! Hai un ramo chiamato "birthday", puoi digitare `git checkout birthday` per arrivarci. + +[setup] + +echo "Incarta il regalo di compleanno e prendi il biglietto del concerto." > you +git add . +git commit -m "Preparazione serale" +echo "Vai alla festa di compleanno!" >> you +git add . +git commit -m "Vai al compleanno" + +git checkout HEAD~1 +echo "Vai al concerto!" > you +git add . +git commit -m "Vai al concerto" + +git checkout HEAD~1 + +git branch -D main + +[win] + +# Crea un ramo chiamato 'birthday' questo punta alla linea temporale del compleanno +git show birthday | grep 'birthday' + +# Crea un ramo chiamato 'concert' questo punta alla linea temporale del compleanno +git show concert | grep 'concert' + +[congrats] + +Adesso tu puoi viaggiare tra quie rami facilmente (usando `git checkout`) - Prova! + +Il tuo amico è felice che tu sia andato alla sua festa di compleanno e anche tu sei contento del biglietto del concerto firmato. Yay! diff --git a/levels/branches/it/branch-remove b/levels/branches/it/branch-remove new file mode 100644 index 0000000..00a2d4c --- /dev/null +++ b/levels/branches/it/branch-remove @@ -0,0 +1,47 @@ +title = Cancellare rami +cards = checkout commit-auto reset-hard branch-delete + +[description] + +La vita è piena di pericolim, vero? Anche quando cammini a scuola2, sembra che ci siano molti rischi! + +Questo Lunedì è particolarmente brutto.Sei arrivato a scuola ma ci sono delle line temporali che tu non vuoi tenere in giro + +[setup] + +echo Esci di casa e ti incammini verso la scuola. > you +git add . +git commit -m "Buon giorno!" + +echo Cammini nel lato destro della strada. >> you +git commit -am "Lato destro" + +echo Salti in un tombino nel marciapiede e arrivi in orario a scuola. >> you +git commit -am "Salto" + +git checkout HEAD^ -b friend +echo "All'improvviso cadi in una pozzanghera puzzolente e vieni mangiato da degli alligatori." >> you +git commit -am "Un nuovo amico" + +git checkout HEAD~2 -b music +echo Cammini nel lato sinistro della strada. >> you +git commit -am "Lato sinistro" + +echo Siccome sei in ritardo, inizi a corre ma qualcuno lanci un pianoforte dalla finestra e ti schiacci. >> you +git commit -am "Bei suoni" + +git checkout HEAD^ -b ice-cream +echo Non sei preoccupato e cammini lentamente. Prendi anche un gelato per strada. Arrivi troppo tardi a scuola, il tuo insegnante è arrabbiato e vieni espulso da scuola. >> you +git commit -am "Yum" + +git branch -M main leap +git checkout leap^^ + +[win] + +# Trova i rami cattivi e cancellali. Tieni solo il migliore. +test "$(git show-ref --heads | cut -f2 -d' ')" = "$(echo refs/heads/leap)" + +[congrats] + +Ripensandoci preferisci la linea temporale del gelato? :) diff --git a/levels/branches/it/checkout-commit b/levels/branches/it/checkout-commit new file mode 100644 index 0000000..3d913df --- /dev/null +++ b/levels/branches/it/checkout-commit @@ -0,0 +1,43 @@ +title = Muoversi attraverso il tempo +cards = checkout commit-auto + +[description] + +La scatole gialle sono un punto fisso nel tempo, possiamo chiamarli "commits"! Puoi viaggiare tra loro usando la carta "checkout"! (Provala!) + +Puoi scoprire cosa è successo qui? Quindi, durante ultimo commit, modifica i files per risolvere il problema ed invia un nuovo commit! + +[cli] + +Guarda uno specifico commit, digita `git checkout` uno spazio e premi il tasto destro sopra il commit che vuoi! + +Questo inserirà l'identificatore unico del commit! + +[setup] + +echo "Questo salvadanaio appartiene alla sorella maggiore. +Contiene 10 monete." > piggy_bank +git add . +git commit -m "L'inizio" + +echo "Una giovane donna con capelli, ricci, marroni." > little_sister +git add . +git commit -m "La sorella piccola è arrivata" + +echo "Ha 10 monete." >> little_sister +echo "Questo salvadanaio appartiene alla sorella maggiore. +E' vuoto." > piggy_bank +git add . +git commit -m "La sorella piccola ha fatto qualcosa" + +git checkout HEAD^^ +git branch -df main + +[win] + +# Ripristina il salvadanaio della sorella. +{ git show HEAD:piggy_bank | grep "10 monete"; } && { git show HEAD:little_sister | grep -v "10 monete"; } && { git rev-parse HEAD^^^; } + +[congrats] + +Stupendo! Adesso hai preso famiglirità con la macchina del tempo, vediamo situazioni più complicate... diff --git a/levels/branches/it/fork b/levels/branches/it/fork new file mode 100644 index 0000000..46b94c6 --- /dev/null +++ b/levels/branches/it/fork @@ -0,0 +1,65 @@ +title = Crea universi paralleli +cards = checkout commit-auto + +[description] + +Sai che creare line temporali parallele è perfettamente legale e sicuro? Vero! + +Puoi scoprire qundo le cose sono andate male in questo zoo? Poi torna all'ultimo momento buono e crea un universo parallelo dove sono tutti felicy! + +[cli] + +L'animale blue rappresenta un concetto conosciuto come "HEAD pointer" in Git: Ti mostra qual'è il commit attuale. + +Ecco un simpatico trucchetto andare al commit precedente: + + git checkout HEAD^ + +Puoi anche andare indietro di 2 commit digitando, pre esempio: + + git checkout HEAD~2 + +[setup] + +mkdir cage +echo "Sembra molto affamato." > cage/lion + +echo "Un ragazzino.. +Ama veramente i gatti!" > child +git add . +git commit -m "L'inizio" + +echo "Tiene in mano un leccalecca." >> child +git commit -am "Il ragazzo compra qualcosa" + +mv child cage +git add . +git commit -m "Il bambino si arrampica da qualche parte" + +git rm cage/child +echo "E' felice. :)" > cage/lion +git add . +git commit -m "Oh no" + +echo "Sta dormendo." > cage/lion +git add . +git commit -m "Ora del pisolino!" + +git checkout --detach +git branch -d main + +[win] + +# Assicurati che il ragazzino sia felice. +git ls-tree --name-only -r HEAD | grep child + +# Assicurati che il leone abbia qualcosa da mangiare. +git show HEAD:cage/lion | grep -v "molto affamato" + +[congrats] + +Whew, ottimo lavoro! Questo sembra un risultato molto migliore. + +Sentiti libero di aggiungere altre line temporali parallele o allungarle. + +Se sei pronto, la prossima missione ci sta aspettando... diff --git a/levels/branches/it/grow b/levels/branches/it/grow new file mode 100644 index 0000000..d560682 --- /dev/null +++ b/levels/branches/it/grow @@ -0,0 +1,48 @@ +title = I rami crescono con tè! +cards = checkout commit-auto branch branch-delete reset-hard + +[description] + +Nota che ci sono due opzioni per "viaggire fino alla fine della linea temporale": + +Primo, puoi direttamente viaggiare al commit, come abbiamo fatto prima. + +e secondo, puoi viaggiare fino all'etichetta del ramo. In questo caso, quando crei un nuovo commit, il ramo cresce con te e punta ancora alla fine della linea temporale! + +[cli] +Per viaggire in un ramo, digita `git checkout name_of_the_branch`. + +e per viaggiare all'ultimo commit, digita `git checkout --detach name_of_the_branch`. + +[setup] + +echo "In carti il regalo di complanno e prendi il biglietto del concerto." > you +git add . +git commit -m "Preparazioni della sera" +echo "Vai alla festa di compleanno!" >> you +git add . +git commit -m "Vai alla festa di compleanno" +git branch birthday + +git checkout HEAD~1 +echo "Vai al concerto!" > you +git add . +git commit -m "Vai al concerto" +git branch concert + +git checkout HEAD~1 + +git branch -D main + +[win] + +# Viaggi direttamente all'ultimo commit giallo della line temporale del compleanno, fai un cambiamento per te e crea un commit +for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do + if test $(git rev-parse $commit^) = $(git rev-parse birthday); then + return 0 + fi +done +return 1 + +# Viaggi fino al ramo, blue, del concerto, fai un cambiamento ed un commit. +git show concert^ | grep "Vai al concerto" diff --git a/levels/branches/it/reorder b/levels/branches/it/reorder new file mode 100644 index 0000000..d8a0212 --- /dev/null +++ b/levels/branches/it/reorder @@ -0,0 +1,89 @@ +title = Muovere i rami +cards = checkout commit-auto merge reset-hard + +[description] + +Uno dei tuoi colleghi ha fatto un casino qui e ha messo le branches nelle line temporali sbagliate! + +Potresti cancellare e ricreare queste branches - ma puoi anche muoverle direttamente in un differente commit usando: + + git checkout + +nel nome della branch e poi usare + + git reset --hard + +nel commit dove vuoi che la branch vada. + +La ciambella è nella branch giusto ma la linea temporale è incompleta - fai *mangiare* la ciambella a quella branch! + +[setup] + +echo "Tu non hai una baguette. + +Non hai un caffe. + +Non hai una ciambella." > you + +git add . +git commit -m "L'inizio" + +git checkout -b coffee +echo "Tu hai una baguette. + +Non hai un caffe. + +Non hai una ciambella." > you +git add . +git commit -m "Compri una ciambella" + +echo "Mangi una baguette. + +Non hai un caffe. + +Non hai una ciambella." > you +git add . +git commit -m "Mangi una baguette" + +git checkout -b baguette main +echo "Non hai una ciambella. + +Hai un caffe. + +Non hai una ciambella." > you +git add . +git commit -m "Compri un pò di caffe" + +echo "Non hai una baguette. + +Hai bevuto caffe. + +Non hai una ciambella." > you +git add . +git commit -m "Bevi il caffe" + +git checkout -b donut main +echo "Non hai una baguette. + +Non hai caffe. + +Hai una ciambella." > you +git add . +git commit -m "Compri una ciambella" + +git checkout --detach main + +[win] + +# Mangi una baguette nella branch delle baguette? +git show baguette:you | grep "Mangi.*baguette" + +# Bevi un caffe nella branch del caffe? +git show coffee:you | grep "Bevi.*coffe" + +# Mangi una ciambella nella branch delle ciambelle? +git show donut:you | grep "Mangi.*ciambella" + +[actions] + +test "$(git rev-parse HEAD^)" = "$(git rev-parse donut)" && hint "Ricordati di controllare l'etichetta branch blue quando vuoi che cresca con la linea temporale." diff --git a/levels/changing-the-past/rebase b/levels/changing-the-past/en/rebase similarity index 100% rename from levels/changing-the-past/rebase rename to levels/changing-the-past/en/rebase diff --git a/levels/changing-the-past/reorder b/levels/changing-the-past/en/reorder similarity index 100% rename from levels/changing-the-past/reorder rename to levels/changing-the-past/en/reorder diff --git a/levels/changing-the-past/it/rebase b/levels/changing-the-past/it/rebase new file mode 100644 index 0000000..a704c80 --- /dev/null +++ b/levels/changing-the-past/it/rebase @@ -0,0 +1,86 @@ +title = Rebasing +cards = checkout commit-auto reset-hard rebase + +[description] + +Okay - Salta vuori che risparmiare tempo al mattino utilizzando universi paralleli è contro il regolamento dell'International Time Travel Association. Dovrai svolgere i tuoi compiti in sequenza dopotutto. + +Vedi la carta "rebase"? Quando la trascini su di un commit, copierà dopo di esso tutti gli eventi della linea temporale su cui ti trovi! In questo modo crei una linea temporale chiara e pulita dove visiti tutti e tre i negozzi. + +Nuovamente, vogliamo rendere questa la nostra realtà di base - il ramo "main" dovrebbe puntare a quella linea temporale! + +[setup] + +echo "Non hai una baguette. + +Non hai caffe. + +Non hai una ciambella." > you + +git add . +git commit -m "L'inizio" + +git checkout -b baguette main +echo "Hai una baguette. + +Non hai caffe. + +Non hai una ciambella." > you +git add . +git commit -m "Compri una baguette" + +echo "Mangi una baguette. + +Non hai caffe. + +Non hai una ciambella." > you +git add . +git commit -m "Mangi la baguette" + +git checkout -b coffee main +echo "Non hai una baguette. + +Hai del caffe. + +Non hai una ciambella." > you +git add . +git commit -m "Compri un pò di caffe" + +echo "Non hai una baguette. + +Hai bevuto caffe. + +Non hai una ciambella." > you +git add . +git commit -m "Bevi il caffe" + +git checkout -b donut main +echo "Non hai una baguette + +Non hai caffe. + +Hai una ciamebella." > you +git add . +git commit -m "Compri una ciambella" + +echo "Non hai una baguette. + +Non hai caffe. + +Mangi una ciambella." > you +git add . +git commit -m "Mangi la ciambella" + +git checkout --detach main + + +[win] + +# Ordina le tre ramificazioni in una e muovi il riferimento al ramo principale +{ git show main:you | grep "Mangi.*baguette"; } && { git show main:you | grep "bevuto.*caffe"; } && { git show main:you | grep "Mangi.*ciambella"; } && { test "$(git log main --oneline | wc -l)" -eq 7; } + +[congrats] + +Nota come gli altri commit e linee temporali siano ancora li - se qualcosa va storto, puoi ancora tornare in dietro. + +E' davvero difficile *distruggere* le cose con la tua macchina del tempo. diff --git a/levels/changing-the-past/it/reorder b/levels/changing-the-past/it/reorder new file mode 100644 index 0000000..8bbe21a --- /dev/null +++ b/levels/changing-the-past/it/reorder @@ -0,0 +1,77 @@ +title = Riordinare gli eventi +cards = checkout commit-auto reset-hard rebase-interactive cherry-pick + +[description] + +Oops, guarda c'è qualcosa di incasinato qui. Puoi rimettere gli eventi nel corretto ordine? + +Ci sono due modi per farlo: Puoi trascinare la carta "interactive rebase" sul commit precedente a quello che vuoi cambiare, poi riordinare le linee nel file che si apre e salvarlo. +Oppure puoi reimpostare il tag principale al primo commit, quindi selezionare i singoli commit (cherry-pick) nell'ordine desiderato. Hai carte per entrambe i modi! + +[setup] + +echo "Ti sei appena svegliato. + +Non indossi biancheria intima. + +Non indossi pantaloni. + +Non indossi la maglia. + +Non indossi le scarpe." > you +git add . + +git commit -m "L'inizio" + +echo "Ti sei appena svegliato. + +Non indossi biancheria intima. + +Non indossi pantaloni. + +Non indossi la maglia. + +Indossi le scarpe." > you +git commit -am "Metti le scarpe" + +echo "Ti sei appena svegliato. + +Non indossi biancheria intima. + +Indossi pantaloni. + +Non indossi la maglia. + +Indossi le scarpe." > you +git commit -am "Metti i pantaloni" + +echo "Ti sei appena svegliato. + +Indossi la biancheria intima. + +Indossi pantaloni. + +Non indossi la maglia. + +Indossi le scarpe." > you +git commit -am "Metti biancheria intima" + +echo "Ti sei appena svegliato. + +Indossi biancheria intima. + +Indossi pantaloni. + +Indossi la maglia. + +Indossi le scarpe." > you +git commit -am "Ti metti la maglia" + +[win] + +# Riordina i commit per vestirti nel modo corretto +{ git log main --oneline | perl -0777 -ne'exit(1) if not /scarpe[\s\S]*pantaloni[\s\S]*biancheria/'; } && { test "$(git log main --oneline | wc -l)" -eq 5; } + +[congrats] + +Sentiti libero di resettare il livello e provare l'altra strategia! Qual'è quella che preferisci? diff --git a/levels/files/files-add b/levels/files/en/files-add similarity index 100% rename from levels/files/files-add rename to levels/files/en/files-add diff --git a/levels/files/files-delete b/levels/files/en/files-delete similarity index 100% rename from levels/files/files-delete rename to levels/files/en/files-delete diff --git a/levels/files/it/files-add b/levels/files/it/files-add new file mode 100644 index 0000000..f0149b9 --- /dev/null +++ b/levels/files/it/files-add @@ -0,0 +1,31 @@ +title = Arredatore di interni +cards = file-new file-delete + +[description] + +Ora che la tua stanza sembra in ordine, puoi iniziare a disfare le tue cose. Hai portato con te due mobili nuovi e con un sorriso luminoso, +vedi che i loro colori corrispondono al colore del tuo letto! + +Costruisci i tuoi due mobili usando la carta touch. +Quindi dai il nome ai tuoi mobili - puoi sciegliere quello che tu vuoi. + +Assicurati che i colori siano uguali! Puoi trovare il colore del letto nella descrizione. +Non dimenticare di aggiungere un colore e una descrizione anche ai tuoi nuovi mobile. + +[setup] +echo Un accogliente letto giallo. > bed + +[win] + +# Aggiungi altri due mobili +NUM_FILES="$(ls | wc -l)" +test "$NUM_FILES" -ge 3 + +# Assicurati che i colori corrispondano a quelle del tuo letto +NUM_FILES="$(ls | wc -l)" +YELLOW_FILES="$(grep -li giallo * | wc -l)" +test "$NUM_FILES" -ge 2 && test "$YELLOW_FILES" = "$NUM_FILES" + +[congrats] + +Non ti senti già più a casa? diff --git a/levels/files/it/files-delete b/levels/files/it/files-delete new file mode 100644 index 0000000..9b207dc --- /dev/null +++ b/levels/files/it/files-delete @@ -0,0 +1,36 @@ +title = Coinquilini inaspettati +cards = file-delete + +[description] + +Il primo giorno alla Scuola del viaggio nel tempo sta per finire e tu ricevi le chiavi della tua stanza. +Eccitatissimo apri la porta giusto per vedere... ragnatele! Ragnatele ovunque! + +Cava tutte le ragnatele che puoi trovare con la carta remove! + +[cli] + +Nella line di comando, puoi facilmente eliminare tutti i file che finiscono in "web" usando il comando: + + rm *web + +[setup] + +echo Una piccola ragnatela è accanto alla tua finestra. > tiny_web +echo Una grande ragnatela attaccata sopra al tuo letto. > big_web +echo Un letto accogliente. > bed +echo Una ragnatela spessa è alla destra della tua porta. > thick_web + +[win] + +# Rimuovi tutte le ragnatele. +! ls | grep thick_web && +! ls | grep big_web && +! ls | grep tiny_web + +# Ma assicurati di mantenere il tuo letto! +ls | grep bed + +[congrats] + +Guarda la tua stanza adesso è davvero ordinata ed accogliente! Il momento per disfare le valige! diff --git a/levels/index/add b/levels/index/en/add similarity index 100% rename from levels/index/add rename to levels/index/en/add diff --git a/levels/index/change b/levels/index/en/change similarity index 100% rename from levels/index/change rename to levels/index/en/change diff --git a/levels/index/checkout b/levels/index/en/checkout similarity index 100% rename from levels/index/checkout rename to levels/index/en/checkout diff --git a/levels/index/compare b/levels/index/en/compare similarity index 100% rename from levels/index/compare rename to levels/index/en/compare diff --git a/levels/index/new b/levels/index/en/new similarity index 100% rename from levels/index/new rename to levels/index/en/new diff --git a/levels/index/reset b/levels/index/en/reset similarity index 100% rename from levels/index/reset rename to levels/index/en/reset diff --git a/levels/index/rm b/levels/index/en/rm similarity index 100% rename from levels/index/rm rename to levels/index/en/rm diff --git a/levels/index/steps b/levels/index/en/steps similarity index 100% rename from levels/index/steps rename to levels/index/en/steps diff --git a/levels/index/it/add b/levels/index/it/add new file mode 100644 index 0000000..e627917 --- /dev/null +++ b/levels/index/it/add @@ -0,0 +1,38 @@ +title = Updating files in the index +cards = add commit checkout + +[description] + +So you start working, and make changes to your files! Git lets you choose which of these changes you want to put in the next commit. This is like updating the index version of that file to the new version. + +This allows you to have smaller commits, that describe better what you changed! + +The command for this is the same - `git add`! + +[setup] + +echo a > a +echo b > b +echo c > c +git add . +git commit -m "Initial commit" + +[win] + +# Make changes to all files! +test "$(cat a)" != "a" && +test "$(cat b)" != "b" && +test "$(cat c)" != "c" + +# Add only the changes of a and c, and make a commit! Finally, make a commit which captures the changes in b! + +test "$(git show main:a)" != "a" && +test "$(git show main:b)" != "b" && +test "$(git show main:c)" != "c" && +test "$(git show main^:a)" != "a" && +test "$(git show main^:b)" == "b" && +test "$(git show main^:c)" != "c" + +[congrats] + +Well done! Try tavelling between the commits using `git checkout`, so you can look at their contents again! diff --git a/levels/index/it/change b/levels/index/it/change new file mode 100644 index 0000000..970ffd6 --- /dev/null +++ b/levels/index/it/change @@ -0,0 +1,31 @@ +title = Aggiornare i file nell'indice +cards = add commit + +[description] + +Quando cambiamo i files l'indice non cambia da solo. Dobbiamo usare `git add` per aggiornare l'indice alla nuova versione del file.. + +Proviamoci! + +Le icone nel file manager ti mostrano quando il file attuale (bianco) e la versione nell'indice (blu) differiscono o sono uguali! + +[win] + +Bene! L'indice è anche chiamato "staging area" (area di staging) - E contiene esattamente ciò che finisce nel prossimo commit quando usi `git commit`! + +[setup] + +echo "La candela brucia con una fiamma blu." > candle +git add . +git commit -m "L'inizio" + +[win] + +# Fai una modifica alla candela +test "$(git diff --name-only)" = "candle" || file -f .git/candle-changed && touch .git/candle-changed + +# Aggiungi la candella. +test "$(git diff --cached --name-only)" = "candle" || file -f .git/candle-added && touch .git/candle-added + +# Fai un commit. +test "$(git diff --name-only HEAD HEAD^)" = "candle" diff --git a/levels/index/it/checkout b/levels/index/it/checkout new file mode 100644 index 0000000..3c01b09 --- /dev/null +++ b/levels/index/it/checkout @@ -0,0 +1,25 @@ +title = Checking out files from the index +cards = add reset-file checkout-file commit + +[description] + +So you've made changes to your files, but you decide that you don't want to keep them! You can use `git checkout` for that! + +What happens if you have already update the index, like in file c? You have to reset the index first! + +[setup] + +echo a > a +echo b > b +echo c > c +git add . +git commit -m "Initial commit" +echo x > a +echo x > b +echo x > c +git add c + +[win] + +# Remove all changes in your local files! +test "$(git diff --name-only | wc -l)" -eq 0 diff --git a/levels/index/it/compare b/levels/index/it/compare new file mode 100644 index 0000000..557b654 --- /dev/null +++ b/levels/index/it/compare @@ -0,0 +1,51 @@ +title = Passo dopo passo +cards = checkout commit-auto + +[description] + +Benvenuto! nella lezione di oggi impareremo come creare commits con più precisione! + +Dai un'occhiata a queste due linee temporali. Hanno lo stesso risultato, ma in una delle due è molto più semplice capire cosa è successo. + +[win] + +# Esatto! Avere ogni cambiamento nel proprio commit rende più facile capire cosa sta succedendo! +git branch --show-current | grep step-by-step + +[setup] + +echo "Una piccola ma pesante palla di vetro." > ball +echo "Un sottile libro che sta in piedi." > book +echo "Una candela brucia con una fiamma blu." > candle +echo "Un sensore di fumo. E' assolutamente silenzioso." > smoke_detector + +git add . +git commit -m "L'inizio" + +git branch -M all-at-once + +echo "La palla adesso tocca il libro." > ball +echo "Il libro è caduto." > book +echo "La candella è stata spenta." > candle + +git commit -am "La fine" + +git checkout HEAD^ + +git checkout -b step-by-step + +echo "La palla adesso tocca il libro." > ball +git commit -am "La palla rotola verso il libro" + +echo "Il libro è caduto." > book +git commit -am "Il libro è caduto" + +echo "La candela è stata spenta." > candle +git commit -am "Il libro ha spento la candela" + +git checkout HEAD~3 + +[win] + +# Prendi la sequenza temporale più chiara e fai suonare il sensore di fumo! +git show step-by-step:smoke_detector | tail -n 1 | grep -v "assolutamente silenzioso" diff --git a/levels/index/it/new b/levels/index/it/new new file mode 100644 index 0000000..4ce39ec --- /dev/null +++ b/levels/index/it/new @@ -0,0 +1,28 @@ +title = Aggiungere nuovi file all'indice +cards = add commit + +[description] + +Finora, quando abbiamo eseguito un commit abbiamo sempre registrato lo stato di tutti gli oggetti, vero? + +Ma Git ti permette di scegliere i cambiamenti che si vogliono mettere in un commit! + +Per sapere come funziona, dobbiamo conoscere l'"indice"! Nell'indice, possiamo preparare ciò che sarà nel prossimo commit. In questo gioco, l'indice è rappresentato da un'aura blu attorno alle icone nel file manager! + +Inizialmente, l'indice è vuoto. Per fare un commit che contenga un nuovo file, dobbiamo aggiungerlo! + +[cli] + +Puoi usare il completamento con la tabulazione nel terminale! Inizia a scrivere il nome di un file e premi il tasto tab per completarlo. Così risparmi tempo! + +[setup] + +echo "La candela brucia con una fiamma blu." > candle + +[win] + +# Aggiungi la candela. +test "$(git diff --cached --name-only)" = "candle" || file -f .git/candle-added && touch .git/candle-added + +# Crea un commit. +test "$(git ls-tree --name-only HEAD)" = "candle" diff --git a/levels/index/it/reset b/levels/index/it/reset new file mode 100644 index 0000000..fd118fd --- /dev/null +++ b/levels/index/it/reset @@ -0,0 +1,37 @@ +title = Resettare i file nell'indice +cards = add reset-file commit + +[description] + +Vedi l'ombra scura dietro le icone? Questa è la versione del file nell'ultimo commit! + +Per esempio, queste candele sono state spente e quella modifica è stata aggiunta! + +Ma è stato un errore! Vuoi solo spegnere al candela rossa nel prossimo commit! + +Se hai già aggiunto un file modificato all'indice ma vuoi ripristinarlo, puoi usare `git reset`! + +[setup] + +echo "Sta bruciando!" > red_candle +echo "Sta bruciando!" > green_candle +echo "Sta bruciando!" > blue_candle +git add . +git commit -m "L'inizio" + +echo "È stata spenta." > red_candle +echo "È stata spenta." > green_candle +echo "È stata spenta." > blue_candle +git add . + +[win] + +# Ripristina i cambiamenti nella candela verde e in quella blu! +git show :green_candle | grep burning && +git show :blue_candle | grep burning && +git show :red_candle | grep -v burning + +# E fai un commit +git show main:green_candle | grep burning && +git show main:blue_candle | grep burning && +git show main:red_candle | grep -v burning diff --git a/levels/index/it/rm b/levels/index/it/rm new file mode 100644 index 0000000..637fd22 --- /dev/null +++ b/levels/index/it/rm @@ -0,0 +1,24 @@ +title = Delete a file in the next commit +cards = add reset-file checkout-file rm file-delete commit + +[description] + +If you want to remove a file in the next commit, you can use `git rm`! This will both delete the file locally, and in the index. + +If a file is modified, you'll need to reset these changes first/reset the files. + +[setup] + +echo a > a +echo x > b +echo x > c +git add . +git commit -m "Initial commit" +echo x > a +echo b > b +git add b + +[win] + +# Make a commit where all files are deleted ¯\_(^_^)_/¯ +test "$(git ls-tree main | wc -l)" -eq 0 diff --git a/levels/index/it/steps b/levels/index/it/steps new file mode 100644 index 0000000..8c13af7 --- /dev/null +++ b/levels/index/it/steps @@ -0,0 +1,53 @@ +title = Aggiungere le modifice una per volta +cards = add reset-file commit + +[description] + +L'indice è veramente utile perché ci permette di essere precisi su quali cambiamenti vogliamo includere in ogni commit! + +[setup] + +echo "Un martello, in equilibrio sul suo manico." > hammer +echo "Una bottiglia contenente un liquido trasparente." > bottle +echo "Un cubetto di zucchero bianco." > sugar_cube + +git add . +git commit -m "L'inizio" + +[win] + +# Fai dei cambiamenti a tutti e tre gli oggetti per creare una sequenza logica di eventi! +test "$(git diff --name-only | wc -l)" -eq 3 || file -f .git/candle-changed && touch .git/candle-changed + +# Aggiungi solo uno dei cambiamenti! +test "$(git diff --cached --name-only | wc -l)" -eq 1 || file -f .git/candle-added && touch .git/candle-added + +# E fai un commit +COUNT=0 +for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do + if test "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; then + COUNT=$((COUNT+1)) + fi +done + +test "$COUNT" -ge 1 + +# Fai un secondo commit che registri solo un singolo cambiamento. +COUNT=0 +for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do + if test "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; then + COUNT=$((COUNT+1)) + fi +done + +test "$COUNT" -ge 2 + +# E aggiungine un terzo. +COUNT=0 +for commit in $(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep 'commit$' | cut -f1 -d' '); do + if test "$(git diff --name-only $commit $commit^ | wc -l)" -eq 1; then + COUNT=$((COUNT+1)) + fi +done + +test "$COUNT" -ge 3 diff --git a/levels/intro/cli b/levels/intro/en/cli similarity index 100% rename from levels/intro/cli rename to levels/intro/en/cli diff --git a/levels/intro/commit b/levels/intro/en/commit similarity index 100% rename from levels/intro/commit rename to levels/intro/en/commit diff --git a/levels/intro/copies b/levels/intro/en/copies similarity index 100% rename from levels/intro/copies rename to levels/intro/en/copies diff --git a/levels/intro/init b/levels/intro/en/init similarity index 100% rename from levels/intro/init rename to levels/intro/en/init diff --git a/levels/intro/remote b/levels/intro/en/remote similarity index 100% rename from levels/intro/remote rename to levels/intro/en/remote diff --git a/levels/intro/risky b/levels/intro/en/risky similarity index 100% rename from levels/intro/risky rename to levels/intro/en/risky diff --git a/levels/intro/who-are-you b/levels/intro/en/who-are-you similarity index 100% rename from levels/intro/who-are-you rename to levels/intro/en/who-are-you diff --git a/levels/intro/it/cli b/levels/intro/it/cli new file mode 100644 index 0000000..c643fc1 --- /dev/null +++ b/levels/intro/it/cli @@ -0,0 +1,27 @@ +title = La line di comando +cards = + +[description] + +Queste carte da gioco sono state disegnate per essere usate e ricordate facilmente! Ti consigliamo di attenerti a loro se non hai molta esperienza di Git! + +[cli] + +Ma c'è un'altra via per interagire con Git: + +Prova a digitare `git init` nel terminale qui sotto e premere il pulsante Enter! + +[setup] + +rm -rf .git + +[win] + +# Inizializza la macchina del tempo! +test -d .git + +[congrats] + +Perfetto! Al posto di usare le carte da gioco, puoi anche fare tutto dalla line di comando! + +La line di comando e piuttosto potente! A volte, puoi usarla per risolvere le attività più velocemente che con l'interfaccia grafica. diff --git a/levels/intro/it/commit b/levels/intro/it/commit new file mode 100644 index 0000000..1141ae1 --- /dev/null +++ b/levels/intro/it/commit @@ -0,0 +1,32 @@ +title = Il tuo primo commit! +cards = commit-auto + +[description] + +Puoi usare la tua macchina del tempo per scattare istantanee degli oggetti intorno a te! Qui puoi metterlo in pratica! + +(Il tuo insegnante versa un pò di acqua nel bicchiere) + +[cli] +Nuovamente, al posto di usare le carte, puoi scrivere i comandi, che sono stampati sulle carte, nel terminale in basso! + +Questo è totalmente opzionale! Ma questa è una conoscenza super utile nel mondo reale - e ti farà avere un distintivo scintillante! :) + +[setup] + +echo "Il bicchiere è pieno di acqua." > glass + +[win] + +# Crea un'istantanea del bicchiere (un "commit") +git rev-parse HEAD + +# Cambia il contenuto del bicchiere! +! test "$(cat glass)" = "Il bicchiere è pieno di acqua." + +# E crea un secondo "commit"! +git rev-parse HEAD^ && ! test "$(git show main:glass)" = "Il bicchiere è bieno di acqua." + +[congrats] + +Perfetto! Puoi provare a creare altri "commit". Quando ti sentirai a posto, premi su "Next Level". diff --git a/levels/intro/it/copies b/levels/intro/it/copies new file mode 100644 index 0000000..8f8d6ce --- /dev/null +++ b/levels/intro/it/copies @@ -0,0 +1,42 @@ +title = Crea una copia +cards = + +[description] + +Questa volta, stai facendo molte copie di backup - puoi guardarli cliccandoci sopra! + +[congrats] + +Okay, questo è un modo di lavorare. + +Ma sei preoccupato che ti ritroverai con centinaia di copie di questo modulo e sarà difficile tenerne traccia nel tempo. + +Specialmente quando lavori con altre persone, inviare copie avanti ed indietro non sembra l'ideale. + +Fermati, devi provare questa macchina del tempo! + +[setup] + +rm -rf .git + +echo "~ Perchè voglio imparare Git ~ + +(Devo ancora scriverlo.)" >> form.txt + + +echo "~ Perchè volgio imparare Git ~ + +- Così posso annullare gli errori" >> form2.txt + + +echo "~ Perchè volgio imparare Git ~ + +- Così posso annullare gli errori +- Per tracciare i mie progetti attraverso il tempo" >> form2_final.txt + +cp form2_final.txt form2_really_final.txt + +[win] + +# Aggiungi una nuova line al file form2_really_final.txt! +test "$(cat form2_really_final.txt | wc -l )" -ge 5 diff --git a/levels/intro/it/init b/levels/intro/it/init new file mode 100644 index 0000000..260f6e9 --- /dev/null +++ b/levels/intro/it/init @@ -0,0 +1,24 @@ +title = Entra nella machina del tempo +cards = init + +[description] + +Sei stato accettato nella scuola della macchina del tempo! Questo è il tuo primo giorno! Il tuo insegnate ti spiega: + +"Per fare qualsiasi cosa con una macchina del tempo, devi prima inizializzarla!" + +Trascina quella carta blu verso l'alto per usarla! + +[setup] + +rm -rf .git + +[win] + +# Inizializzazione della macchina del tempo +test -d .git + +[congrats] + +Perfetto! Vedi quel piccolo animale che è apparso? Sarà il tuo compagno e ti mostrerà dove ti trovi nel tempo! + diff --git a/levels/intro/it/remote b/levels/intro/it/remote new file mode 100644 index 0000000..c0b582a --- /dev/null +++ b/levels/intro/it/remote @@ -0,0 +1,52 @@ +title = Dai lavoriamo tutti assieme +cards = pull commit-auto push + +[description] + +Aggiungi il tuo nome nella nostra lista di studenti! + +Ho già un secondo "commit" nella mia macchina del tempo - Dai lavoriamo tutti assieme! + +[cli] + +Per tornare in dietro alle vecchie istruzioni, puoi premere la freccia in alto o in basso. In questo modo non devi digitare, nuovamente, le istruzioni. + +[congrats] + +Benvenuto nella scuola del viaggio nel tepo! :) Ci vediamo domani per la tua prima lezione! + +[setup] + +echo "~ Lista degli attuali studenti ~" > students +git add . +git commit -m "Versione iniziale" +git push -u teacher main + +git update-ref -d refs/remotes/teacher/main + +[setup teacher] + +git reset --hard main + +echo " +- Sam +- Alex" >> students + +git add . +git commit -m "Aggiunti due studenti" + +[win] + +# Ottieni il secondo "commit" dal tuo insegnante usando `git pull`. +test "$(git log --oneline teacher/main | wc -l)" -ge 2 + +# Aggiungi il tuo nome alla lista degli studenti. +test "$(cat students |wc -l)" -ge 5 + +# Crea un'istantanea dei risultati. +test "$(git show main:students |wc -l)" -ge 5 + +[win teacher] + +# E usa `git push` per inviarlo al tuo insegnante! +test "$(git show main:students |wc -l)" -ge 5 diff --git a/levels/intro/it/risky b/levels/intro/it/risky new file mode 100644 index 0000000..57a52d1 --- /dev/null +++ b/levels/intro/it/risky @@ -0,0 +1,42 @@ +title = Vivere è pericoloso +cards = + +[description] + +Quindi hai deciso di fare domanda per la scuola di viaggio nel tempo, per usare la macchina del tempo chiamata "Git"! + +Che emozione! + +Hai quasi concluso le scartoffie! Devi solamente inserire un motivo per il quale vuoi imparare Git. + +[congrats] + +All'improvviso, il tuo gatto salta sul tavolo, strappa via il modulo, e scappa via! Oh no. Tutto il tuo duro lavoro, andato! + +Devi trovare una buona soluzione. + +(Premi "Prossimo livello" appena sei pronto!) + +[setup] + +rm -rf .git + +echo "~ Perchè voglio imparare Git ~ + +- Così posso cancellare gli errori +- Per seguire il mio progetto attraverso il tempo" >> form.txt + +[actions] + +test "$(cat form.txt | wc -l )" -ge 5 && echo "(E' stato rubato dal tuo gatto.) + + + + + +" > form.txt + +[win] + +# Aggiungi un'altra line a form.txt! +test "$(cat form.txt | wc -l )" -ge 5 diff --git a/levels/intro/it/who-are-you b/levels/intro/it/who-are-you new file mode 100644 index 0000000..abb94f3 --- /dev/null +++ b/levels/intro/it/who-are-you @@ -0,0 +1,38 @@ +title = Benvenuto nella scuola del viaggio nel tempo! +cards = config-name commit-auto checkout + +[description] + +Sei ancora confuso da tutto quello che sta succedendo. Il giorno seguente, decidi di iscriverti nella scuola del viaggio nel tempo! + +Il tuo insegnante del viaggio nel tempo ti saluta: "Ciao come va! Vuoi dirci il tuo nome?" + +[setup] + +git config --global user.name "TU" + +echo "~ Chi vuole imparare come si usa la macchina del tempo? ~ + +[ ] Per essere sicuro che il mio gatto non mangi il mio lavoro. +[ ] Così non devo tenere copie di tutti i miei saggi. +[ ] Per collaborare con altri studenti del viaggio nel tempo. +[ ] Altro, perfavore specifica:" > form + +[actions] + +test "$(git config user.name)" != "TU" && cat form | grep -v Signature && echo " +Firma: $(git config user.name)" >> form + +[win] + +# Presentati. +test "$(git config user.name)" != "TU" + +# Compila l'iscrizione e inviala! +git show main:form | grep '\[[xX]\]' + +[congrats] + +"Siamo lieti di averti con noi! + +Git puoi aiutarti a correggere i problemi del passato! Ti aiuta a collaborare con gli studenti del viaggio nel tempo! E' davvero potente e e popolare! Ci vediamo domani per la tua prima lezione!" diff --git a/levels/low-level/basics b/levels/low-level/en/basics similarity index 100% rename from levels/low-level/basics rename to levels/low-level/en/basics diff --git a/levels/low-level/blob-create b/levels/low-level/en/blob-create similarity index 100% rename from levels/low-level/blob-create rename to levels/low-level/en/blob-create diff --git a/levels/low-level/blob-remove b/levels/low-level/en/blob-remove similarity index 100% rename from levels/low-level/blob-remove rename to levels/low-level/en/blob-remove diff --git a/levels/low-level/commit-create b/levels/low-level/en/commit-create similarity index 100% rename from levels/low-level/commit-create rename to levels/low-level/en/commit-create diff --git a/levels/low-level/commit-parents b/levels/low-level/en/commit-parents similarity index 100% rename from levels/low-level/commit-parents rename to levels/low-level/en/commit-parents diff --git a/levels/low-level/commit-rhombus b/levels/low-level/en/commit-rhombus similarity index 100% rename from levels/low-level/commit-rhombus rename to levels/low-level/en/commit-rhombus diff --git a/levels/low-level/index-add b/levels/low-level/en/index-add similarity index 100% rename from levels/low-level/index-add rename to levels/low-level/en/index-add diff --git a/levels/low-level/index-remove b/levels/low-level/en/index-remove similarity index 100% rename from levels/low-level/index-remove rename to levels/low-level/en/index-remove diff --git a/levels/low-level/index-update b/levels/low-level/en/index-update similarity index 100% rename from levels/low-level/index-update rename to levels/low-level/en/index-update diff --git a/levels/low-level/puzzle-apocalypse b/levels/low-level/en/puzzle-apocalypse similarity index 100% rename from levels/low-level/puzzle-apocalypse rename to levels/low-level/en/puzzle-apocalypse diff --git a/levels/low-level/puzzle-precious-blob b/levels/low-level/en/puzzle-precious-blob similarity index 100% rename from levels/low-level/puzzle-precious-blob rename to levels/low-level/en/puzzle-precious-blob diff --git a/levels/low-level/puzzle-trees-all-the-way-down b/levels/low-level/en/puzzle-trees-all-the-way-down similarity index 100% rename from levels/low-level/puzzle-trees-all-the-way-down rename to levels/low-level/en/puzzle-trees-all-the-way-down diff --git a/levels/low-level/ref-create b/levels/low-level/en/ref-create similarity index 100% rename from levels/low-level/ref-create rename to levels/low-level/en/ref-create diff --git a/levels/low-level/ref-move b/levels/low-level/en/ref-move similarity index 100% rename from levels/low-level/ref-move rename to levels/low-level/en/ref-move diff --git a/levels/low-level/ref-remove b/levels/low-level/en/ref-remove similarity index 100% rename from levels/low-level/ref-remove rename to levels/low-level/en/ref-remove diff --git a/levels/low-level/symref-create b/levels/low-level/en/symref-create similarity index 100% rename from levels/low-level/symref-create rename to levels/low-level/en/symref-create diff --git a/levels/low-level/symref-no-deref b/levels/low-level/en/symref-no-deref similarity index 100% rename from levels/low-level/symref-no-deref rename to levels/low-level/en/symref-no-deref diff --git a/levels/low-level/tree-create b/levels/low-level/en/tree-create similarity index 100% rename from levels/low-level/tree-create rename to levels/low-level/en/tree-create diff --git a/levels/low-level/tree-nested b/levels/low-level/en/tree-nested similarity index 100% rename from levels/low-level/tree-nested rename to levels/low-level/en/tree-nested diff --git a/levels/low-level/tree-read b/levels/low-level/en/tree-read similarity index 100% rename from levels/low-level/tree-read rename to levels/low-level/en/tree-read diff --git a/levels/low-level/welcome b/levels/low-level/en/welcome similarity index 100% rename from levels/low-level/welcome rename to levels/low-level/en/welcome diff --git a/levels/low-level/it/basics b/levels/low-level/it/basics new file mode 100644 index 0000000..55374b5 --- /dev/null +++ b/levels/low-level/it/basics @@ -0,0 +1,26 @@ +[description] + +For this prototype, we assume you have some experience with the command line. Here are some commands that will be useful: + +- ls +- echo content > file +- cat file +- mkdir dir + +Find the riddle in your current directory and put the answer into the file "answer"! + +[congrats] + +Omnomnom! + +For technical reasons, you can't use `cd` in this prototype yet. But there won't be a lot of interaction with the file system anyways. :) + +[setup] + +mkdir riddle +echo "ppl p" > riddle/consonants +echo "ae ie" > riddle/vowels + +[win] + +cat answer | grep -i "apple \\?pie" diff --git a/levels/low-level/it/blob-create b/levels/low-level/it/blob-create new file mode 100644 index 0000000..86f6254 --- /dev/null +++ b/levels/low-level/it/blob-create @@ -0,0 +1,38 @@ +[description] + +At its core, Git is very simple. It stores "objects", which are basically files identified by an "identifier" (short: ID). + +There are four types of objects: blobs, trees, commits, and tags. The simplest type is a "blob", which is just a piece of text. + +Let's create some blobs! To do that, create a file with the desired content, and then use + + git hash-object -w + +The flag -w means "write", and tells Git to actually write the new blob to the disk. + +Create three new blobs! + +[congrats] + +Tip: You can also use a command like this to create a blob in a single line: + + echo "awesome content" | git hash-object -w --stdin + +Did you already notice that you can drag and drop all objects? :) + +[setup] + +[setup goal] + +echo "Hi" > file1 +echo "Ho" > file2 +echo "Hu" > file3 +git hash-object -w file1 +git hash-object -w file2 +git hash-object -w file3 + +[win] + +BLOB_COUNT=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep blob | wc -l) + +test "$BLOB_COUNT" -gt 2 diff --git a/levels/low-level/it/blob-remove b/levels/low-level/it/blob-remove new file mode 100644 index 0000000..bbc1b30 --- /dev/null +++ b/levels/low-level/it/blob-remove @@ -0,0 +1,27 @@ +[description] + +There's a simple command to remove all objects that are not referenced by anything: + + git prune + +Remove all blobs in this repository. + +[congrats] + +Generally, `git prune` will be useful if you want to clean up some objects you made. + +Alternatively, you can also click the "Reload" button to restart a level. + +[setup] + +echo "My master password is a1b2c3d4e5" | git hash-object -w --stdin +echo "This blob really should not exist" | git hash-object -w --stdin +echo "This is a virus" | git hash-object -w --stdin + +[setup goal] + +[win] + +OBJECT_COUNT=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | wc -l) + +test "$OBJECT_COUNT" -eq 0 diff --git a/levels/low-level/it/commit-create b/levels/low-level/it/commit-create new file mode 100644 index 0000000..79a8e52 --- /dev/null +++ b/levels/low-level/it/commit-create @@ -0,0 +1,37 @@ +[description] + +So a tree describes a directory structure at a specific point in time. + +It would be nice if we could remember when that state existed, and who authored it, right? + +Enter: commits. They are objects that point to a tree and contain some additional metadata. You can create a commit using + + git commit-tree -m "Description of your commit" + +Make a commit from the tree in this repository! + +[setup] + +touch empty_file +git add . +git write-tree + +rm empty_file +git update-index --remove empty_file + +[setup goal] + +touch empty_file +git add . +git write-tree + +rm empty_file +git update-index --remove empty_file + +git commit-tree 3185 -m 'Clever commit message' + +[win] + +COMMIT_COUNT=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | wc -l) + +test "$COMMIT_COUNT" -gt 0 diff --git a/levels/low-level/it/commit-parents b/levels/low-level/it/commit-parents new file mode 100644 index 0000000..a2efb11 --- /dev/null +++ b/levels/low-level/it/commit-parents @@ -0,0 +1,31 @@ +[description] + +When using the commit-tree command, you can optionally specify a parent: + + git commit-tree -m "Description" -p + +Make a string of three commits! + +Hint: You'll need a tree object. What could be the easiest way to obtain one? + +[setup] + +[setup goal] + +git write-tree +FIRST_COMMIT=$(git commit-tree 4b82 -m 'First commit :O') +SECOND_COMMIT=$(git commit-tree 4b82 -p $FIRST_COMMIT -m 'Second commit :D') +THIRD_COMMIT=$(git commit-tree 4b82 -p $SECOND_COMMIT -m 'Third commit \o/') + +[win] + +COMMITS=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | cut -f1 -d" ") + +for COMMIT in $COMMITS; do + echo a commit named $COMMIT + if [ $(git rev-list $COMMIT | wc -l) -ge 3 ]; then + return 0 + fi +done + +return 1 diff --git a/levels/low-level/it/commit-rhombus b/levels/low-level/it/commit-rhombus new file mode 100644 index 0000000..e320ca0 --- /dev/null +++ b/levels/low-level/it/commit-rhombus @@ -0,0 +1,30 @@ +[description] + +A commit can have multiple parents! You can specify the -p option multiple times, like this: + + git commit-tree -m "Description" -p -p + +Build a rhombus shape from commits, where two commits point to the same parent, and then a fourth commit points to both of them. + +[setup] + +[setup goal] + +TREE=$(git write-tree) +SOUTH=$(git commit-tree $TREE -m "South") +EAST=$(git commit-tree $TREE -m "East" -p $SOUTH) +WEST=$(git commit-tree $TREE -m "West" -p $SOUTH) +NORTH=$(git commit-tree $TREE -m "Nort" -p $EAST -p $WEST) + +[win] + +COMMITS=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep commit | cut -f1 -d" ") + +for COMMIT in $COMMITS; do + # My first parent's parents has to be the same as my second parent's parent. + if [ "$(git rev-parse --verify -q $COMMIT^1^)" = "$(git rev-parse --verify -q $COMMIT^2^)" ]; then + return 0 + fi +done + +return 1 diff --git a/levels/low-level/it/index-add b/levels/low-level/it/index-add new file mode 100644 index 0000000..633245c --- /dev/null +++ b/levels/low-level/it/index-add @@ -0,0 +1,37 @@ +[description] + +Blobs usually represent the content of a file. But on their own, they don't have any metadata, not even a name! + +Git has a very powerful concept to store metadata related to blobs: the index! It's a list that relates blobs to filenames and access permissions. + +The most convenient option to add an entry to the index is via an existing file: + + echo "my content" > file + git update-index --add file + +Add three entries to the index! For a bonus challenge: can you add a file that is inside of a directory, like "directory/file"? + +[congrats] + +There's another way to add an entry to the index directly: + + git update-index --add --cacheinfo ,, + +The first three numbers of the mode describe the type of the entry, "100" is a regular file. + +The second three number describe the permissions. Only "644" (non-executable) and "755" (executable) are supported. + +You can insert the hash of an object into the terminal by right-clicking on it! :) + +[setup] + +[setup goal] + +echo "file 1" > file1 +echo "file 2" > file2 +echo "file 3" > file3 +git add . + +[win] + +test "$(git ls-files | wc -l)" -ge 3 diff --git a/levels/low-level/it/index-remove b/levels/low-level/it/index-remove new file mode 100644 index 0000000..9816126 --- /dev/null +++ b/levels/low-level/it/index-remove @@ -0,0 +1,29 @@ +[description] + +To remove an entry from the index, use a command like this: + + git update-index --force-remove + +Remove all entries from the index! + +[setup] + +echo "file 1" > file1 +echo "file 2" > file2 +echo "file 3" > file3 +git add . + +[setup goal] + +echo "file 1" > file1 +echo "file 2" > file2 +echo "file 3" > file3 +git add . + +git update-index --force-remove file1 +git update-index --force-remove file2 +git update-index --force-remove file3 + +[win] + +test "$(git ls-files | wc -l)" -eq 0 diff --git a/levels/low-level/it/index-update b/levels/low-level/it/index-update new file mode 100644 index 0000000..047493d --- /dev/null +++ b/levels/low-level/it/index-update @@ -0,0 +1,33 @@ +[description] + +Instead of removing an entry from the index and adding one with the same name, you can also directly update that entry! + +Put the content you want in a file with a matching name, and then run + + git update-index + +This will create a new blob, and update the hash of the entry to that blob. + +Update an entry in the index! + +[setup] + +echo "file 1" > file1 +echo "file 2" > file2 +echo "file 3" > file3 +git add . + +[setup goal] + +echo "file 1" > file1 +echo "file 2" > file2 +echo "file 3" > file3 +git add . + +echo "new content" > file1 +git update-index file1 + +[win] + +# This is not really a good test for the winning condition... +test "$(git ls-files -s | git hash-object --stdin)" != "10c4b28623e7e44e09f5a596450a50ab7ac31fbe" -a "$(git ls-files | wc -l)" -eq 3 diff --git a/levels/low-level/it/puzzle-apocalypse b/levels/low-level/it/puzzle-apocalypse new file mode 100644 index 0000000..119784d --- /dev/null +++ b/levels/low-level/it/puzzle-apocalypse @@ -0,0 +1,41 @@ +[description] + +Delete all objects in this repository using git commands only! + +Useful commands: + + git prune + git reflog expire + +[setup] + +echo foo > foo +BLOB=$(git hash-object -w foo) +echo bar > bar +git add . +git commit -m "Initial commit" +echo blabber >> bar +git commit -a -m "Second commit" +git update-ref refs/important HEAD +git update-ref refs/interesting "$BLOB" + +[setup goal] + +echo foo > foo +BLOB=$(git hash-object -w foo) +echo bar > bar +git add . +git commit -m "Initial commit" +echo blabber >> bar +git commit -a -m "Second commit" +git update-ref refs/important HEAD +git update-ref refs/interesting "$BLOB" + +TREE=$(git mktree) +git read-tree $TREE +rm -rf .git/refs/* +rm -rf .git/objects/* + +[win] + +test "$(git cat-file --batch-check --batch-all-objects | wc -l)" -eq 0 diff --git a/levels/low-level/it/puzzle-precious-blob b/levels/low-level/it/puzzle-precious-blob new file mode 100644 index 0000000..865cfdf --- /dev/null +++ b/levels/low-level/it/puzzle-precious-blob @@ -0,0 +1,28 @@ +[description] + +Create two trees pointing to the same blob! + +[setup] + +[setup goal] + +BLOB=$(echo "I am precious" | git hash-object -w --stdin) +git update-index --add --cacheinfo 100644,$BLOB,a +git write-tree +git update-index --force-remove a +git update-index --add --cacheinfo 100644,$BLOB,b +git write-tree +git update-index --force-remove b + +[win] + +TREES=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep tree | cut -f1 -d" ") + +ALL_TREE_CHILDREN=$(for TREE in $TREES; do + git cat-file -p $TREE | cut -f1 | cut -f3 -d" " +done) + +NUMBER_OF_CHILDREN=$(echo "$ALL_TREE_CHILDREN" | wc -l) +UNIQUE_CHILDREN=$(echo "$ALL_TREE_CHILDREN" | sort -u | wc -l) + +test "$NUMBER_OF_CHILDREN" -gt "$UNIQUE_CHILDREN" diff --git a/levels/low-level/it/puzzle-trees-all-the-way-down b/levels/low-level/it/puzzle-trees-all-the-way-down new file mode 100644 index 0000000..bc3e58a --- /dev/null +++ b/levels/low-level/it/puzzle-trees-all-the-way-down @@ -0,0 +1,34 @@ +[description] + +Construct a chain of three trees, which don't point to anything else. + +This is hard! The `git mktree` command might be useful. + +[setup] + +[setup goal] + +git mktree +TREE=$(echo -e "040000 tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904\tdir" | git mktree) +echo -e "040000 tree $TREE\tdir" | git mktree + +[win] + +TREES=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep tree | cut -f1 -d" ") + +for TREE in $TREES; do + if [ "$(git cat-file -p $TREE | wc -l)" -eq 1 ]; then + if [ "$(git cat-file -p $TREE | cut -f1 | grep tree | wc -l)" -eq 1 ]; then + # So the tree has exactly one child, and it is a tree! + TREE2=$(git cat-file -p $TREE | cut -f1 | grep tree | cut -f3 -d" ") + if [ "$(git cat-file -p $TREE2 | wc -l)" -eq 1 ]; then + if [ "$(git cat-file -p $TREE2 | cut -f1 | grep tree | wc -l)" -eq 1 ]; then + # Same for its child! \o/ + return 0 + fi + fi + fi + fi +done + +return 1 diff --git a/levels/low-level/it/ref-create b/levels/low-level/it/ref-create new file mode 100644 index 0000000..1cc4bcf --- /dev/null +++ b/levels/low-level/it/ref-create @@ -0,0 +1,42 @@ +[description] + +Let's take a look at "refs" (short for "references")! Refs are not objects, but rather very simple *pointers* to objects! They can help you keep track of what's where. + +You can create or update a ref with + + git update-ref refs/ + +Make sure to always start a ref's name with "refs/"! That's a convention that helps Git find all refs you create. If you forget the "refs/", you will not see the ref. + +Create refs that point to all objects in this repository! + +[setup] + +echo hello > hello +echo world > world +BLOB1=$(git hash-object -w hello) +BLOB2=$(git hash-object -w world) +git add . +TREE=$(git write-tree) +COMMIT=$(git commit-tree $TREE -m "Initial commit") + +[setup goal] + +echo hello > hello +echo world > world +BLOB1=$(git hash-object -w hello) +BLOB2=$(git hash-object -w world) +git add . +TREE=$(git write-tree) +COMMIT=$(git commit-tree $TREE -m "Initial commit") + +git update-ref refs/a $BLOB1 +git update-ref refs/b $BLOB2 +git update-ref refs/c $TREE +git update-ref refs/d $COMMIT + +[win] + +OBJECTS=$(git cat-file --batch-check='%(objectname)' --batch-all-objects | sort) +REF_TARGETS=$(git show-ref -s | sort | uniq) +test "$OBJECTS" = "$REF_TARGETS" diff --git a/levels/low-level/it/ref-move b/levels/low-level/it/ref-move new file mode 100644 index 0000000..e3b29e3 --- /dev/null +++ b/levels/low-level/it/ref-move @@ -0,0 +1,41 @@ +[description] + +You can point refs to a new location using the same command you use to create them: + + git update-ref refs/ + +As an exercise, make all refs in this repository point to the tree object! + +[setup] + +echo hello > hello +echo world > world +BLOB1=$(git hash-object -w hello) +BLOB2=$(git hash-object -w world) +git add . +TREE=$(git write-tree) +COMMIT=$(git commit-tree $TREE -m "Initial commit") + +git update-ref refs/a "$BLOB1" +git update-ref refs/b "$COMMIT" + +[setup goal] + +echo hello > hello +echo world > world +BLOB1=$(git hash-object -w hello) +BLOB2=$(git hash-object -w world) +git add . +TREE=$(git write-tree) +COMMIT=$(git commit-tree $TREE -m "Initial commit") + +git update-ref refs/a "$BLOB1" +git update-ref refs/b "$COMMIT" + +for REF in $(git for-each-ref --format='%(refname)'); do + git update-ref "$REF" "$TREE" +done + +[win] + +test "$(git show-ref -s | sort -u)" = "c7863f72467ed8dd44f4b8ffdb8b57ca7d91dc9e" diff --git a/levels/low-level/it/ref-remove b/levels/low-level/it/ref-remove new file mode 100644 index 0000000..d1fa982 --- /dev/null +++ b/levels/low-level/it/ref-remove @@ -0,0 +1,41 @@ +[description] + +And finally, to delete a ref, use + + git update-ref -d refs/ + +Delete all refs! :P (Well, except for HEAD. HEAD is special.) + +[setup] + +echo hello > hello +echo world > world +BLOB1=$(git hash-object -w hello) +BLOB2=$(git hash-object -w world) +git add . +TREE=$(git write-tree) +COMMIT=$(git commit-tree $TREE -m "Initial commit") + +git update-ref refs/best_blob_ever "$BLOB1" +git update-ref refs/beautiful_commit "$COMMIT" + +[setup goal] + +echo hello > hello +echo world > world +BLOB1=$(git hash-object -w hello) +BLOB2=$(git hash-object -w world) +git add . +TREE=$(git write-tree) +COMMIT=$(git commit-tree $TREE -m "Initial commit") + +git update-ref refs/best_blob_ever "$BLOB1" +git update-ref refs/beautiful_commit "$COMMIT" + +for REF in $(git for-each-ref --format='%(refname)'); do + git update-ref -d "$REF" +done + +[win] + +test "$(git show-ref | wc -l)" -eq 0 diff --git a/levels/low-level/it/symref-create b/levels/low-level/it/symref-create new file mode 100644 index 0000000..da933cb --- /dev/null +++ b/levels/low-level/it/symref-create @@ -0,0 +1,21 @@ +[description] + +Instead of pointing directly to objects, refs can also point to other refs! + +When that happens, they are called "symbolic refs". You can create or update a symbolic ref using + + git symbolic-ref + +Create a symbolic ref called "refs/rainbow"! + +[setup] + +[setup goal] + +BLOB=$(git hash-object -w --stdin) +git update-ref refs/double "$BLOB" +git symbolic-ref refs/rainbow refs/double + +[win] + +git symbolic-ref refs/rainbow diff --git a/levels/low-level/it/symref-no-deref b/levels/low-level/it/symref-no-deref new file mode 100644 index 0000000..458e669 --- /dev/null +++ b/levels/low-level/it/symref-no-deref @@ -0,0 +1,46 @@ +[description] + +When you have a symbolic ref (a ref pointing at another ref), and you decide you want it to be a regular ref again (pointing to an object), you're in for some trouble! :) + +What happens when you try pointing the symbolic ref directly to the blob using `git update-ref`? + +Oops! Turns out that when you reference a symbolic ref, it acts as if you had specified the ref it points to. To de-symbolic-ize it, use the `--no-deref` option directly after `update-ref`! + +Weird, huh? + +[congrats] + +Whew, we've covered a lot of things: Blobs! The index! Trees! Commits! Refs! + +You now know about almost everything about how Git repositories look like on the inside! We think that's pretty cool! :) + +Everything else is just convention and high-level commands that make interacting with the objects more convenient. + +We haven't covered: + +- tag objects (they are the fourth object type - a bit like refs with a description and an author) +- configuration (allows you to specify remote repositories, for example) +- working with local files (which is, uh, arguably pretty important :P) + +Thanks for playing! You're welcome to check out the "puzzle" levels in the dropdown, some of them are more advanced! + +[setup] + +BLOB1=$(echo delicious | git hash-object -w --stdin) +BLOB2=$(echo very | git hash-object -w --stdin) +git update-ref refs/curly "$BLOB1" +git symbolic-ref refs/fries refs/curly + +[setup goal] + +BLOB1=$(echo delicious | git hash-object -w --stdin) +BLOB2=$(echo very | git hash-object -w --stdin) +git update-ref refs/curly "$BLOB1" +git symbolic-ref refs/fries refs/curly + +git update-ref --no-deref refs/fries "$BLOB2" + +[win] + +git symbolic-ref refs/fries && return 1 +test "$(git show-ref -s refs/fries)" = "035e2968dafeea08e46e8fe6743cb8123e8b9aa6" diff --git a/levels/low-level/it/tree-create b/levels/low-level/it/tree-create new file mode 100644 index 0000000..3da3618 --- /dev/null +++ b/levels/low-level/it/tree-create @@ -0,0 +1,35 @@ +[description] + +After carefully building the index we want, it would be nice to save a permanent snapshot of it, right? + +This is what the second type of objects is for: trees! You can convert the index into a tree using + + git write-tree + +Try it! :) + +[congrats] + +Nice! + +Can you make a different tree? Modify the index, then call `git write-tree` again! + +[setup] + +echo "file 1" > file1 +echo "file 2" > file2 +echo "file 3" > file3 +git add . + +[setup goal] + +echo "file 1" > file1 +echo "file 2" > file2 +echo "file 3" > file3 +git add . + +git write-tree + +[win] + +git cat-file -p 21a638f28022064c1f1df20844278b494d197979 diff --git a/levels/low-level/it/tree-nested b/levels/low-level/it/tree-nested new file mode 100644 index 0000000..c7afce8 --- /dev/null +++ b/levels/low-level/it/tree-nested @@ -0,0 +1,38 @@ +[description] + +Trees can also point to other trees! This way, they can describe nested directory structures. + +When you add a file inside of a directory to the index, and then call `git write-tree`, it will create a nested tree for the directory, and attach the blob to it. + +To solve this level, build a little stick figure, as shown on the left - a tree that points to two blobs, as well to a tree that points to two blobs. + +[setup] + +[setup goal] + +echo "I'm the left arm" > arm1 +echo "I'm the right arm" > arm2 +mkdir hip +echo "I'm the left leg" > hip/leg1 +echo "I'm the right leg" > hip/leg2 +git add . +git write-tree + +[win] + +TREES=$(git cat-file --batch-check='%(objectname) %(objecttype)' --batch-all-objects | grep tree | cut -f1 -d" ") + +for OUTER_TREE in $TREES; do + NUMBER_OF_BLOB_CHILDREN=$(git cat-file -p $OUTER_TREE | cut -f2 -d" " | grep blob | wc -l) + NUMBER_OF_TREE_CHILDREN=$(git cat-file -p $OUTER_TREE | cut -f2 -d" " | grep tree | wc -l) + + if [ $NUMBER_OF_BLOB_CHILDREN -eq 2 -a $NUMBER_OF_TREE_CHILDREN -eq 1 ]; then + TREE_CHILD=$(git cat-file -p $OUTER_TREE | cut -f1 | grep tree | cut -d" " -f3) + NUMBER_OF_BLOB_CHILDREN_OF_TREE_CHILD=$(git cat-file -p $TREE_CHILD | cut -f2 -d" " | grep blob | wc -l) + if [ $NUMBER_OF_BLOB_CHILDREN_OF_TREE_CHILD -eq 2 ]; then + return 0 + fi + fi +done + +return 1 diff --git a/levels/low-level/it/tree-read b/levels/low-level/it/tree-read new file mode 100644 index 0000000..ba8c440 --- /dev/null +++ b/levels/low-level/it/tree-read @@ -0,0 +1,51 @@ +[description] + +As soon as you have some tree objects, you can always read them and set the index exactly to their content! Unsurprisingly, the command is called + + git read-tree + +For , you can provide the hash of any tree object - you can right-click one to insert its hash into the terminal! + +Try reading some of the trees in this repository into the index! + +[setup] + +EMPTY_TREE=$(git write-tree) + +echo "file 1" > file1 +echo "file 2" > file2 +git add . +git write-tree + +rm * +echo "file A" > fileA +echo "file B" > fileB +echo "file C" > fileC +git add . +TRIPLE_TREE=$(git write-tree) + +git read-tree "$EMPTY_TREE" + +[setup goal] + +EMPTY_TREE=$(git write-tree) + +echo "file 1" > file1 +echo "file 2" > file2 +git add . +git write-tree + +rm * +echo "file A" > fileA +echo "file B" > fileB +echo "file C" > fileC +git add . +TRIPLE_TREE=$(git write-tree) + +git read-tree "$EMPTY_TREE" + +git read-tree "$TRIPLE_TREE" + +[win] + +test "$(git ls-files | wc -l)" -gt 0 diff --git a/levels/low-level/it/welcome b/levels/low-level/it/welcome new file mode 100644 index 0000000..d669136 --- /dev/null +++ b/levels/low-level/it/welcome @@ -0,0 +1,33 @@ +[description] + +This is prototype #1 for the Git learning game by @bleeptrack and @blinry. Thanks for checking it out! <3 + +You can interact with the repository labelled "yours" by typing Bash commands in the terminal below! The visualization will show you its internal status. + +Let's get started by initializing an empty Git repository in the current directory by typing: + + git init + +[congrats] + +Well done! + +An empty Git repository is... well, quite empty. The only thing that always exists is a reference called "HEAD" - we'll learn what that is later! + +But first, let's look at some basics! + +(Click "Next Level" as soon as you're ready!) + +[setup] + +rm -rf .git + +[setup goal] + +rm -rf .git + +git init + +[win] + +test -d .git diff --git a/levels/merge/conflict b/levels/merge/en/conflict similarity index 100% rename from levels/merge/conflict rename to levels/merge/en/conflict diff --git a/levels/merge/merge b/levels/merge/en/merge similarity index 100% rename from levels/merge/merge rename to levels/merge/en/merge diff --git a/levels/merge/merge-abort b/levels/merge/en/merge-abort similarity index 100% rename from levels/merge/merge-abort rename to levels/merge/en/merge-abort diff --git a/levels/merge/it/conflict b/levels/merge/it/conflict new file mode 100644 index 0000000..645b5ed --- /dev/null +++ b/levels/merge/it/conflict @@ -0,0 +1,47 @@ +title = Contraddizioni +cards = checkout commit-auto merge reset-hard + +[description] + +A volte le linee temporali si contraddicono a vicenda. + +Per esempio, in questo caso, un nostro cliente vuole che queste linee temporali siano unite ma hanno mangiato cose differenti in entrambe le linee temporali. + +Prova ad unirle! Noterai che c'è un conflitto! La macchina del tempo ti lascerà decidere come procedere: puoi modificare l'elemento problematico, ti verranno mostrate le parti che vanno in conflitto. Puoi mantenere una delle due versioni o creare una combinazione di entrambe! Poi rimuovi i marcatori >>>, <<<, e === e crea un nuovo commit per finalizare l'unione! + +La tua linea temporale definitiva è "main". + +[setup] + +echo "Si è appena svegliato. È affamato." > sam +git add . +git commit -m "L'inizio" + +git checkout -b pancakes +echo "Ha fatto colazione con pancakes ai mirtilli e sciroppo d'acero." > sam +git add . +git commit -m "Pancakes!" + +echo " +È al lavoro." >> sam +git commit -am "Va al lavoro" + +git checkout -b muesli main +echo "Ha fatto colazione con muesli all'avena e fragole." > sam +git add . +git commit -m "Muesli!" + +echo " +È al lavoro." >> sam +git commit -am "Va al lavoro" + +git checkout main + +[win] + +# Crea un compromesso tra le due colazioni nel branch "main". +git rev-parse main^ && test "$(git rev-parse main^1^^)" = "$(git rev-parse main^2^^)" + +[congrats] + +Yum, questa sembra una buona colazione! diff --git a/levels/merge/it/merge b/levels/merge/it/merge new file mode 100644 index 0000000..9050cb7 --- /dev/null +++ b/levels/merge/it/merge @@ -0,0 +1,82 @@ +title = Unire le linee temporali +cards = checkout commit-auto merge + +[description] + +Ecco un trucco per domire un pò più a lungo: svolgi tutte le tue attività mattutine in universi paralleli, e poi uniscile! + +[setup] + +echo "Non hai una baguette. + +Non hai caffe. + +Non hai una ciambella." > you + +git add . +git commit -m "L'inizio" + +echo "Hai una baguette. + +Non hai caffe. + +Non hai una ciambella." > you +git add . +git commit -m "Compri una baguette" + +echo "Mangi una baguette. + +Non hai caffe. + +Non hai una ciambella." > you +git add . +git commit -m "Mangi la baguette" + +git checkout HEAD~2 +echo "Non hai una baguette. + +Hai caffe. + +Non hai una ciambella." > you +git add . +git commit -m "Compri un pò di caffe" + +echo "Non hai una baguette. + +Bevi il caffe. + +Non hai una ciambella." > you +git add . +git commit -m "Bevi il caffe" + +git checkout HEAD~2 +echo "Non hai una baguette. + +Non hai caffe. + +Hai una ciambella." > you +git add . +git commit -m "Compri una ciambella" + +echo "Non hai una baguette. + +Non hai caffe. + +Mangi una ciambella." > you +git add . +git commit -m "Mangi la ciambella" + +git checkout --detach +git branch -D main + +[win] + +# Crea una situazione dove consumi una baguette, un caffe e una ciambella. +{ git show HEAD:you | grep "Mangi.*baguette"; } && { git show HEAD:you | grep "Bevi.*caffe"; } && { git show HEAD:you | grep "Mangi.*ciambella"; } + +# Crea (e spostati su) un commit di unione. +test "$(git log --pretty=%P -n 1 HEAD | wc -w)" -ge 2 + +[congrats] + +Mi chiedo se sei più rilassato quando *dormi* in linee temporali parallele... diff --git a/levels/merge/it/merge-abort b/levels/merge/it/merge-abort new file mode 100644 index 0000000..efabb5d --- /dev/null +++ b/levels/merge/it/merge-abort @@ -0,0 +1,54 @@ +title = Interrompere un merge +cards = checkout commit-auto merge merge-abort + +[description] + +Può capitare che tu voglia unire il contenuto di due commit ma si verifica un conflitto che al momento non vuoi risolvere. + +In queste situazioni, puoi interrompere il merge per riprendere successivamente. Usa + git merge --abort +mentre sei nel processo di merge. + +Prova a unire i due commit e interrompi la procedura di merge. + +[setup] + +echo "Un nuovo giorno sta iniziando" > you + +git add . +git commit -m "Start" + +echo "Stai camminando sulla corsia principale." >> you + +git add . +git commit -m "Corsia Principale" + + +git checkout HEAD~1 + +echo "Stai camminando sulla corsia laterale." >> you + +git add . +git commit -m "Corsia laterale" + +git checkout HEAD~1 + +git branch -D main + +[actions] + +if test -f .git/MERGE_HEAD; then + touch .git/secretfile +fi + +[win] + +# Hai provato a fare il merge? +test -f .git/secretfile + +# Hai interrotto il merge? +test -f .git/secretfile && ! test -f .git/MERGE_HEAD && ! git rev-parse HEAD^^ + +[congrats] + +Aaah, faremo il merge più tardi... diff --git a/levels/remotes/friend b/levels/remotes/en/friend similarity index 100% rename from levels/remotes/friend rename to levels/remotes/en/friend diff --git a/levels/remotes/problems b/levels/remotes/en/problems similarity index 100% rename from levels/remotes/problems rename to levels/remotes/en/problems diff --git a/levels/remotes/it/friend b/levels/remotes/it/friend new file mode 100644 index 0000000..c6f46c8 --- /dev/null +++ b/levels/remotes/it/friend @@ -0,0 +1,47 @@ +title = Amici +cards = pull push commit-auto checkout + +[description] + +Il tuo amico ha aggiunto un'altra linea alla tua tesi! Prendilo, aggiungine un'altra e reinvialo! + +Fate botta e risposta fino a che non ti ritrovi ad avere cinque linee! + +[setup yours] + +echo "Linea 1" > essay +git add . +git commit -m "Una linea" + +git push -u friend main + +[setup friend] + +git checkout main +echo "Linea 2, gnihihi" >> essay +git commit -am "Un'altra linea" + +[actions friend] + +if test "$(git log --oneline | wc -l)" -eq 3; then + git reset --hard main # Necessario perché la directory di lavoro non è aggiornata quando viene inviata all'amico + echo "Linea 4, blurbblubb" >> essay + git commit -am "Linea finale" + hint "Oh bene, Ho aggiunto la quarta linea!" +fi + +[win] + +# Ricevuto la seconda linea dal tuo amico. +git show HEAD:essay | grep gnihihi + +# Ricevuto la quarta linea dal tuo amico. +git show HEAD:essay | grep blurbblubb + +[win friend] + +# L'amico ha ricevuto la terza linea da te. +test "$(git show HEAD:essay | wc -l)" -ge 3 + +# L'amico ha ricevuto la quinta linea da te. +test "$(git show HEAD:essay | wc -l)" -ge 5 diff --git a/levels/remotes/it/problems b/levels/remotes/it/problems new file mode 100644 index 0000000..764a6fc --- /dev/null +++ b/levels/remotes/it/problems @@ -0,0 +1,33 @@ +title = Problemi +cards = checkout add pull push commit-auto merge + +[description] + +Entrambi, tu ed il tuo amico, avete lavorato sullo stesso file e volete sincronizare! + +[setup yours] + +echo "Il capannone delle bici dovrebbe essere ???" > file +git add . +git commit -m "inizio" + +git push -u friend main + +echo "Il capannone delle bici dovrebbe essere verde" > file + +[setup friend] + +git checkout main + +echo "Il capannone delle bici dovrebbe essere blu" > file +git commit -a -m "versione dell'amico" + +[win] + +# Fai il commit delle tue modifiche locali. +test "$(git status -s)" = "" + +[win friend] + +# Quarda il suggerimento dell'amico, trova un compromesso e rimandalo in dietro. +git rev-parse main^ && test "$(git rev-parse main^1^)" = "$(git rev-parse main^2^)" diff --git a/levels/sandbox/empty b/levels/sandbox/en/empty similarity index 100% rename from levels/sandbox/empty rename to levels/sandbox/en/empty diff --git a/levels/sandbox/remote b/levels/sandbox/en/remote similarity index 100% rename from levels/sandbox/remote rename to levels/sandbox/en/remote diff --git a/levels/sandbox/three-commits b/levels/sandbox/en/three-commits similarity index 100% rename from levels/sandbox/three-commits rename to levels/sandbox/en/three-commits diff --git a/levels/sandbox/it/empty b/levels/sandbox/it/empty new file mode 100644 index 0000000..1f954a5 --- /dev/null +++ b/levels/sandbox/it/empty @@ -0,0 +1,7 @@ +title = Empty sandbox + +[description] + +This is an empty sandbox you can play around in. + +[setup] diff --git a/levels/sandbox/it/remote b/levels/sandbox/it/remote new file mode 100644 index 0000000..f0ca2c0 --- /dev/null +++ b/levels/sandbox/it/remote @@ -0,0 +1,22 @@ +title = Sandbox with a remote +cards = checkout commit-auto pull fetch push + +[description] + +Here's a sandbox with a remote! Try pulling, fetching, or pushing! + +How can you push tags and branches on a remote? How can you delete them again? + +[setup yours] + +echo "Line 1" > essay +git add . +git commit -m "Initial commit" + +git push -u friend main + +[setup friend] + +git checkout main +echo "Line 2" >> essay +git commit -am "Another line" diff --git a/levels/sandbox/it/three-commits b/levels/sandbox/it/three-commits new file mode 100644 index 0000000..3e5308c --- /dev/null +++ b/levels/sandbox/it/three-commits @@ -0,0 +1,26 @@ +title = Sandbox with three commits +cards = checkout add reset-file checkout-file commit merge rebase + +[setup] + +echo "You wake up." > you +git add . +git commit -m "The beginning" + +echo "You drink coffee." >> you +git commit -am "First things first" + +echo "You hear a knock on the door." >> you +git commit -am "Who's there?" + +git branch not_main + +[description] + +Here's a sandbox you can play around in. + +You can use both the playing cards, as well as the terminal. This is a real Git terminal! Fun things to try: + +- Make a commit that merges three timelines together at once! +- Create and delete some tags! +- Make a timeline that's completely independent of the rest! diff --git a/levels/shit-happens/bad-commit b/levels/shit-happens/en/bad-commit similarity index 100% rename from levels/shit-happens/bad-commit rename to levels/shit-happens/en/bad-commit diff --git a/levels/shit-happens/pushed-something-broken b/levels/shit-happens/en/pushed-something-broken similarity index 100% rename from levels/shit-happens/pushed-something-broken rename to levels/shit-happens/en/pushed-something-broken diff --git a/levels/shit-happens/reflog b/levels/shit-happens/en/reflog similarity index 100% rename from levels/shit-happens/reflog rename to levels/shit-happens/en/reflog diff --git a/levels/shit-happens/restore-a-file b/levels/shit-happens/en/restore-a-file similarity index 100% rename from levels/shit-happens/restore-a-file rename to levels/shit-happens/en/restore-a-file diff --git a/levels/shit-happens/restore-a-file-from-the-past b/levels/shit-happens/en/restore-a-file-from-the-past similarity index 100% rename from levels/shit-happens/restore-a-file-from-the-past rename to levels/shit-happens/en/restore-a-file-from-the-past diff --git a/levels/shit-happens/it/bad-commit b/levels/shit-happens/it/bad-commit new file mode 100644 index 0000000..0febbc2 --- /dev/null +++ b/levels/shit-happens/it/bad-commit @@ -0,0 +1,31 @@ +title = Annullare un cattivo commit +cards = reset commit-a + +[description] + +Oh no, abbiamo fatto un cattivo commit! Come possiamo annullare un commit e tornare ad un punto dove poter riprovare? + +La risposta è usare `git reset [commit]` che fa due cose: + +- Reimposta il riferimento (ref) del ramo corrente al commit che hai specificato. +- Reimposta l'indice a quel commit. + +Non cambia la tua directory di lavoro in nessun modo, il che significa che dopo puoi provare a rifare il commit che desideri. + + +[setup] + +echo "1 2 3 4" > numbers +git add . +git commit -m "commit iniziale" +echo "1 2 3 4 5 6 7 8 9 11" > numbers +git commit -am "Più numerrrrri" + +[win] + +# Nel primo commit il file numbers contiene i numeri da 1 a 10. +test "$(git show main:numbers)" = "1 2 3 4 5 6 7 8 9 10" +# Il messaggio di questo commit è "Più numeri". +git log -1 --oneline | grep "Più numeri" +# Il commit con l'errore si battitura non fa più parte del ramo principale. +git log --oneline | grep -v "rrrrr" diff --git a/levels/shit-happens/it/pushed-something-broken b/levels/shit-happens/it/pushed-something-broken new file mode 100644 index 0000000..cb7f2fb --- /dev/null +++ b/levels/shit-happens/it/pushed-something-broken @@ -0,0 +1,54 @@ +title = Ho fatto il push di qualcosa di rotto +cards = revert push + +[description] + +Stavamo parlando di come annulare un commit e correggerlo. Questo ci aiuta solo quando non lo abbiamo già inviato al server remoto. Quando questo succede e vuoi annullare completamente l'effetto del commit la tua migliore opzione è `git revert` + +[setup] + +echo "questo va bene + +? + +? + +?" > text +git add . +git commit -m bene +echo "questo va bene + +anche questo va bene + +? + +?" > text +git commit -am "anche questo bene" +echo "questo va bene + +anche questo va bene + +questo è veramente sbagliato + +?" > text +git commit -am "veramente sbagliato" +echo "questo va bene + +anche questo va bene + +questo è veramente sbagliato + +questo va nuovamente bene" > text +git commit -am "nuovamente bene" + +git push team main +git branch -u team/main main + +[setup team] + +[win team] + +# Il ramo main del Team non contiene più niente di sbagliato. +! { git show main:text | grep -q "veramente sbagliato"; } +# e la cronologia non è stata modificata. +git show main^:text | grep -q "veramente sbagliato" diff --git a/levels/shit-happens/it/reflog b/levels/shit-happens/it/reflog new file mode 100644 index 0000000..23f7bdc --- /dev/null +++ b/levels/shit-happens/it/reflog @@ -0,0 +1,26 @@ +title = Torna dove eri prima +cards = checkout reflog + +[description] + +Diciamo che stavi guardando qualcosa nel passato e poi sei tornato al ramo principale (main). + +Ma poi ti sei distratto e dopo la pausa pranzo, non riesci a ricordare cosa stavi facendo prima. Come puoi scoprirlo? + +C'è un comodo comando che ti mostra tutti i posti a cui la tua HEAD ha puntato in passato: + + git reflog + +[setup] + +for i in {1..10}; do + git commit --allow-empty -m $i + git branch $i +done +git checkout 3 +git checkout main + +[win] + +# Trova cosa stavi facendo prima e tornaci! +test "$(git rev-parse HEAD)" = "$(git rev-parse 3)" diff --git a/levels/shit-happens/it/restore-a-file b/levels/shit-happens/it/restore-a-file new file mode 100644 index 0000000..16cf0dc --- /dev/null +++ b/levels/shit-happens/it/restore-a-file @@ -0,0 +1,22 @@ +title = Recuperare un file cancellato +cards = checkout + +[description] + +Oops - Hai cancellato il file "essay" dove hai lavorato tutta la notte! + +Stai sereno, Git è qui per aiutare! Puoi usare `git checkout` per recuperare il file! + +[setup] + +echo importante > essay +git add . +git commit -m "Commit iniziale" +echo "contenuto importante" > essay +git commit -am "Ottimizzato essay" +rm essay + +[win] + +# Recupera il file "essay" che contiene "contenuto importante" +test "$(cat essay)" = "contenuto importante" diff --git a/levels/shit-happens/it/restore-a-file-from-the-past b/levels/shit-happens/it/restore-a-file-from-the-past new file mode 100644 index 0000000..c15f2a3 --- /dev/null +++ b/levels/shit-happens/it/restore-a-file-from-the-past @@ -0,0 +1,22 @@ +title = Recuperare un file dal passato +cards = checkout checkout-from commit + +[description] + +Questo è un problema simile: preferivi il file "essay" del primissimo commit e vuoi riaverlo indietro! Bene, checkout puo anche recuperare le cose dai vecchi commits. +Così: + + git checkout [commit] [file] + +[setup] + +echo "versione buona" > essay +git add . +git commit -m "commit iniziale" +echo "versione cattiva" > essay +git commit -am "\"Migliorato\" essay" + +[win] + +# Prendi la prima versione di "essay" e crea un nuovo commit con essa. +test "$(git show main:essay)" = "versione buona" diff --git a/levels/stash/stash b/levels/stash/en/stash similarity index 100% rename from levels/stash/stash rename to levels/stash/en/stash diff --git a/levels/stash/stash-branch b/levels/stash/en/stash-branch similarity index 100% rename from levels/stash/stash-branch rename to levels/stash/en/stash-branch diff --git a/levels/stash/stash-clear b/levels/stash/en/stash-clear similarity index 100% rename from levels/stash/stash-clear rename to levels/stash/en/stash-clear diff --git a/levels/stash/stash-merge b/levels/stash/en/stash-merge similarity index 100% rename from levels/stash/stash-merge rename to levels/stash/en/stash-merge diff --git a/levels/stash/stash-pop b/levels/stash/en/stash-pop similarity index 100% rename from levels/stash/stash-pop rename to levels/stash/en/stash-pop diff --git a/levels/stash/it/stash b/levels/stash/it/stash new file mode 100644 index 0000000..6a4bc61 --- /dev/null +++ b/levels/stash/it/stash @@ -0,0 +1,45 @@ +title = Stashing +cards = checkout commit-auto merge reset-hard + +[description] + +You will encounter situations in which you are working on your project but you need to +put your current changes aside temporarily. To do so, you can use the stash function. Use + git stash push +to add your current changes to the stash stack. + +--- +tipp1 +--- +tipp2 +--- +tipp3 + +[setup] + +echo "Apple Pie:" > recipe + +git add . +git commit -m "creating a recipe" + +echo "- 4 Apples" >> recipe + +git add . +git commit -m "Adding ingredients" + +echo "- 500g Flour" >> recipe + +git checkout main + +[win] + +# Did you stash the current changes? +test "$(git stash list | wc -l)" -ge 1 + +[actions] + + + +[congrats] + +Nice stash you got there! :) diff --git a/levels/stash/it/stash-branch b/levels/stash/it/stash-branch new file mode 100644 index 0000000..e51e4d2 --- /dev/null +++ b/levels/stash/it/stash-branch @@ -0,0 +1,47 @@ +title = Ramo dalla scorta +cards = checkout commit-auto merge reset-hard + +[description] + +Se vuoi matenere tutte le modifiche ma non appartengono al ramo principale, puoi facilemnte creare un nuovo ramo dai cambiamenti dalle modifiche nascoste. Usando + git stash branch +Se vuoi solo usare l'ultimo elemento della scorta puoi lasciare vuota l'opzione . + +Crea un nuovo ramo dalle modifiche nascoste!! + +--- +tipp1 +--- +tipp2 +--- +tipp3 + +[setup] + +echo "Torta di mele:" > recipe + +git add . +git commit -m "creata una ricetta" + +echo "- 4 Mele" >> recipe + +git add . +git commit -m "Aggiunto ingredienti" + +echo "- 500g Farina" >> recipe +git stash push + +git checkout main + +[win] + +# Hai creato un nuovo ramo dai cambiamenti nascosti? +test "$(git branch --list| wc -l)" -ge 2 + +[actions] + + + +[congrats] + +I cambiamenti nascosti sono nel nuovo ramo! :) diff --git a/levels/stash/it/stash-clear b/levels/stash/it/stash-clear new file mode 100644 index 0000000..32f82cb --- /dev/null +++ b/levels/stash/it/stash-clear @@ -0,0 +1,57 @@ +title = Pulire la scorta +cards = checkout commit-auto merge reset-hard + +[description] + +Se vuoi controllare la tua scorta, usa il comando + git stash list + +Oh, non vuoi mantenere i tuoi cambiamenti nella scorta? C'è un modo per farlo? Poi vai avanti e pulisci la scorta con + git stash clear +Se vuoi solo scartare un certo elemento dalla scorta, puoi usare + git stash drop + +Pulisci la tua pila di scorta! + +--- +tipp1 +--- +tipp2 +--- +tipp3 + +[setup] + +echo "Torta di mele:" > recipe + +git add . +git commit -m "creata una ricetta" + +echo "- 4 Mele" >> recipe + +git add . +git commit -m "Aggiunto ingredienti" + +echo "- 500g Farina" >> recipe +git stash push + +echo "- 200g Zucchero" >> recipe +git stash push + +echo "- Pizzico di sale" >> recipe +git stash push + +git checkout main + +[win] + +# Hai pulito la tua pila di scorta? +test "$(git stash list | wc -l)" -eq 0 + +[actions] + + + +[congrats] + +Pulito tutto! :) diff --git a/levels/stash/it/stash-merge b/levels/stash/it/stash-merge new file mode 100644 index 0000000..a4ed759 --- /dev/null +++ b/levels/stash/it/stash-merge @@ -0,0 +1,53 @@ +title = Unire la scorta spuntata +cards = checkout commit-auto merge reset-hard + +[description] + +Quando vuoi riapplicare i cambiamenti ma hai continuato a lavora nei tuoi file, potresti ricevere un conflitto di unione! Facciamo un pò di pratica con questa situazione. +Fai uscire le modifiche dalla scorta con + git stash pop +e risolvi i conflitti di unione. Invia la soluzione dei cambiamenti e dopo pulisci la scorta. + +--- +tipp1 +--- +tipp2 +--- +tipp3 + +[setup] + +echo "Torta di mele:" > recipe + +git add . +git commit -m "creata una ricetta" + +echo "- 4 Mele" >> recipe + +git add . +git commit -m "Aggiunti ingredienti" + +echo "- 500g Farina" >> recipe + +git stash push + +echo "- Pizzico di sale" >> recipe + +git checkout main +git add recipe + +[win] + +# Hai rislto i conflitti ed inviato? +{ git show HEAD | grep "Farina"; } && { git show HEAD | grep "Sale"; } + +# Hai pulito la pila di scorta? +test "$(git stash list | wc -l)" -eq 0 + +[actions] + + + +[congrats] + +Yay, hai riavuto le tue modifiche in dietro! :) diff --git a/levels/stash/it/stash-pop b/levels/stash/it/stash-pop new file mode 100644 index 0000000..cffc30d --- /dev/null +++ b/levels/stash/it/stash-pop @@ -0,0 +1,46 @@ +title = Pop dalla scorta +cards = checkout commit-auto merge reset-hard + +[description] + +Quando hai nascosto le tue modifiche e vuoi riapplicarle nella tua directory di lavoro, puoi usare + git stash pop +Questo rimuoverà i cambiamenti dalla pila di scorta. Se voui anche mantenere le modifiche della pila di scorta usa + git stash apply + +--- +tipp1 +--- +tipp2 +--- +tipp3 + +[setup] + +echo "Torta di mele:" > recipe + +git add . +git commit -m "creata una ricetta" + +echo "- 4 Mele" >> recipe + +git add . +git commit -m "Aggiunto ingredienti" + +echo "- 500g Farina" >> recipe + +git stash push +git checkout main + +[win] + +# Hai pop i cambiamenti dalla pila di scorta? +test "$(git stash list | wc -l)" -eq 0 + +[actions] + + + +[congrats] + +Yay, hai riavuto i tuoi cambiamenti in dietro! :) diff --git a/levels/tags/add-tag b/levels/tags/en/add-tag similarity index 100% rename from levels/tags/add-tag rename to levels/tags/en/add-tag diff --git a/levels/tags/add-tag-later b/levels/tags/en/add-tag-later similarity index 100% rename from levels/tags/add-tag-later rename to levels/tags/en/add-tag-later diff --git a/levels/tags/remote-tag b/levels/tags/en/remote-tag similarity index 100% rename from levels/tags/remote-tag rename to levels/tags/en/remote-tag diff --git a/levels/tags/remove-tag b/levels/tags/en/remove-tag similarity index 100% rename from levels/tags/remove-tag rename to levels/tags/en/remove-tag diff --git a/levels/tags/it/add-tag b/levels/tags/it/add-tag new file mode 100644 index 0000000..2351635 --- /dev/null +++ b/levels/tags/it/add-tag @@ -0,0 +1,53 @@ +title = Creare etichette +cards = checkout commit-auto merge reset-hard + +[description] + +Alcuni dei tuoi commit potrebbero essere commit speciali. Potresti aver raggiunto un traguargo o un nuovo numero di versione. + +Puoi contrassegnare questo commit con un flag spegiale chiamato 'tag'. + +Scrivi + + git tag + +per etichettare il tuo commit. + +--- +tipp1 +--- +tipp2 +--- +tipp3 + +[setup] + +echo "event 1" > elenco-caratteristiche + +git add . +git commit -m "Aggiunta caratteristica 1" + +echo "event 2" >> elenco-caratteristiche + +git add . +git commit -m "Aggiunta caratteristica 2" + +echo "event 3" >> elenco-caratteristiche + +git add . +git commit -m "Aggiunta caratteristica 3" + +git checkout --detach main + +[win] + +# Hai creato un nuovo tag? +test "$(git tag -l | wc -l)" -ge 1 + +[actions] + + + +[congrats] + +Bene! Hai etichettato il tuo primo commit :) diff --git a/levels/tags/it/add-tag-later b/levels/tags/it/add-tag-later new file mode 100644 index 0000000..49e17d4 --- /dev/null +++ b/levels/tags/it/add-tag-later @@ -0,0 +1,50 @@ +title = Etichettare dopo +cards = checkout commit-auto merge reset-hard + +[description] + +Ma cosa succede se ti dimentichi di etichettare il corrente commit? +No c'è problema! Puoi etichettare i vecchi commit tramite + + git tag + +Etichetta il commit "Aggiunta caratteristica 2" con il nome "v1"! + +--- +tipp1 +--- +tipp2 +--- +tipp3 + +[setup] + +echo "event 1" > elenco-caratteristiche + +git add . +git commit -m "Aggiunta caratteristica 1" + +echo "event 2" >> elenco-caratteristiche + +git add . +git commit -m "Aggiunta caratteristica 2" + +echo "event 3" >> elecno-caratteristiche + +git add . +git commit -m "Aggiunta caratteristica 3" + +git checkout --detach main + +[win] + +# Hai creato una nuova etichetta? +test "$(git show v1 -s --format=%h)" = "$(git show HEAD~1 -s --format=%h)" + +[actions] + + + +[congrats] + +Motlo bene :) diff --git a/levels/tags/it/remote-tag b/levels/tags/it/remote-tag new file mode 100644 index 0000000..0a68035 --- /dev/null +++ b/levels/tags/it/remote-tag @@ -0,0 +1,58 @@ +title = Etichette remote +cards = pull push commit-auto checkout + +[description] + +Quando lavori con un repositor remoto, le etichette non sono messe o prese automaticamente. + +Puoi inviare un tag con + git push +O tutti i tags con + git push --tags + +Rimuovere i tags nel repository remoto con + git push --delete + +Puoi anche sincronizzare + git fetch --prune --prune-tags + + +Aggiungere un nome di tag "v2" nell'ultimo commit ed inviarlo nel remoto, anche prendere il tag "v1" in quello locale. +[setup yours] + +git checkout main + +git checkout main +echo "Condivisione dello spazzolino" > project-ideas +git add . +git commit -m "Prima idea" + +echo "Il mio telefono è sottosopra? App" >> project-ideas +git commit -am "Un'altra idea" + + + +git push friend main + +git branch -u friend/main main + +[setup friend] + + + +[actions friend] + +git tag v1 HEAD~1 + +[win] +# v1 tag nel tuo repo +test "$(git show v1 -s --format=%h)" = "$(git show HEAD~1 -s --format=%h)" + +# v2 tag nel tuo repo +test "$(git show v2 -s --format=%h)" = "$(git show HEAD -s --format=%h)" + + +[win friend] + +# v2 tag nel remoto +test "$(git show v2 -s --format=%h)" = "$(git show HEAD -s --format=%h)" diff --git a/levels/tags/it/remove-tag b/levels/tags/it/remove-tag new file mode 100644 index 0000000..2d2dfd9 --- /dev/null +++ b/levels/tags/it/remove-tag @@ -0,0 +1,53 @@ +title = Rimuovere etichette +cards = checkout commit-auto merge reset-hard + +[description] + +Hai aggiunto molte ectichette? Non c'è problema! Cancellali con + + git tag -d + +Rimuovi tutti i tag in questo repository! + +--- +tipp1 +--- +tipp2 +--- +tipp3 + +[setup] + +echo "event 1" > elenco-caratteristiche + +git add . +git commit -m "Aggiunta caratteristica 1" + +echo "event 2" >> elenco-caratteristiche + +git add . +git commit -m "Aggiunta caratteristica 2" + +echo "event 3" >> elenco-caratteristiche + +git add . +git commit -m "Aggiunta caratteristica 3" + +git tag v1 HEAD~2 +git tag v2 HEAD~1 +git tag v3 + +git checkout --detach main + +[win] + +# Hai riosso tutte le etichette? +test "$(git tag -l | wc -l)" -eq 0 + +[actions] + + + +[congrats] + +Molto bene :) diff --git a/levels/unused/checkout b/levels/unused/en/checkout similarity index 100% rename from levels/unused/checkout rename to levels/unused/en/checkout diff --git a/levels/unused/clone b/levels/unused/en/clone similarity index 100% rename from levels/unused/clone rename to levels/unused/en/clone diff --git a/levels/unused/commit b/levels/unused/en/commit similarity index 100% rename from levels/unused/commit rename to levels/unused/en/commit diff --git a/levels/unused/commit-a b/levels/unused/en/commit-a similarity index 100% rename from levels/unused/commit-a rename to levels/unused/en/commit-a diff --git a/levels/unused/fetch b/levels/unused/en/fetch similarity index 100% rename from levels/unused/fetch rename to levels/unused/en/fetch diff --git a/levels/unused/files-move b/levels/unused/en/files-move similarity index 100% rename from levels/unused/files-move rename to levels/unused/en/files-move diff --git a/levels/unused/index-mv b/levels/unused/en/index-mv similarity index 100% rename from levels/unused/index-mv rename to levels/unused/en/index-mv diff --git a/levels/unused/init b/levels/unused/en/init similarity index 100% rename from levels/unused/init rename to levels/unused/en/init diff --git a/levels/unused/pull-push b/levels/unused/en/pull-push similarity index 100% rename from levels/unused/pull-push rename to levels/unused/en/pull-push diff --git a/levels/unused/remotes-add b/levels/unused/en/remotes-add similarity index 100% rename from levels/unused/remotes-add rename to levels/unused/en/remotes-add diff --git a/levels/unused/remotes-delete b/levels/unused/en/remotes-delete similarity index 100% rename from levels/unused/remotes-delete rename to levels/unused/en/remotes-delete diff --git a/levels/unused/restore b/levels/unused/en/restore similarity index 100% rename from levels/unused/restore rename to levels/unused/en/restore diff --git a/levels/unused/split b/levels/unused/en/split similarity index 100% rename from levels/unused/split rename to levels/unused/en/split diff --git a/levels/unused/steps b/levels/unused/en/steps similarity index 100% rename from levels/unused/steps rename to levels/unused/en/steps diff --git a/levels/unused/who-are-you b/levels/unused/en/who-are-you similarity index 100% rename from levels/unused/who-are-you rename to levels/unused/en/who-are-you diff --git a/levels/unused/it/checkout b/levels/unused/it/checkout new file mode 100644 index 0000000..9d9c957 --- /dev/null +++ b/levels/unused/it/checkout @@ -0,0 +1,31 @@ +title = Getting the last version +cards = checkout-file + +[description] + +You've been working on your essay for a while. But - ughh! Now your cat walks over your keyboard and "helps you", so now it's all messed up! :/ + +But Git is here to help! To discard all changes your cat made, and go back to the version in the last commit, use `checkout`! + +[setup] + +echo "A" >> essay.txt +git add . +git commit -m "Initial commit" + +echo "B" >> essay.txt +git commit -a -m "Improved version" + +echo "C" >> essay.txt +git commit -a -m "Even better version" + +echo "D" >> essay.txt +git commit -a -m "Marvelous version" + +echo "blarg +blaaaargh" > essay.txt + +[win] + +# Restore the version from the last commit. +cat essay.txt | grep D diff --git a/levels/unused/it/clone b/levels/unused/it/clone new file mode 100644 index 0000000..8459c08 --- /dev/null +++ b/levels/unused/it/clone @@ -0,0 +1,20 @@ +title = Cloning a repo +cards = clone commit-auto pull push + +[description] + +Get your friend's repo using clone, change something, push it back. + +[setup] + +rm -rf .git + +[setup friend] + +echo hi > file +git add . +git commit -m "Initial commit" + +[win friend] + +test "$(git show main:file)" != hi diff --git a/levels/unused/it/commit b/levels/unused/it/commit new file mode 100644 index 0000000..fd84cc9 --- /dev/null +++ b/levels/unused/it/commit @@ -0,0 +1,27 @@ +title = Make a commit \o/ +cards = add reset checkout commit + +[description] + +For practice, make a commit where all files contain an "x"! + +[setup] + +echo a > a +echo x > b +echo x > c +git add . +git commit -m "Initial commit" +echo x > a +echo b > b +git add b +echo c > c + +[win] + +# File a contains "x" in the last main commit. +test "$(git show main:a)" = x +# File b contains "x" in the last main commit. +test "$(git show main:b)" = x +# File c contains "x" in the last main commit. +test "$(git show main:c)" = x diff --git a/levels/unused/it/commit-a b/levels/unused/it/commit-a new file mode 100644 index 0000000..747a009 --- /dev/null +++ b/levels/unused/it/commit-a @@ -0,0 +1,26 @@ +title = Make a commit, but faster! +cards = add reset checkout commit commit-a + +[description] + +There is a time-saving trick, where instead of a plain `git commit`, you can use + + git commit -a + +This will automatically add all changes you made to local files! Very convenient. + +[setup] + +echo a > a +echo b > b +echo c > c +git add . +git commit -m "Initial commit" +echo x > a +echo x > b +echo x > c + +[win] + +# Make a commit where all files contain "x". +test "$(git show main:a)" = x && test "$(git show main:b)" = x && test "$(git show main:c)" = x diff --git a/levels/unused/it/fetch b/levels/unused/it/fetch new file mode 100644 index 0000000..377355a --- /dev/null +++ b/levels/unused/it/fetch @@ -0,0 +1,35 @@ +title = Fetching from remotes +cards = checkout fetch commit-auto + +[description] + +Here, you already have two remotes configured! You can list them using `git remote`. + +Fetch from both, and look at the suggestions. + +Then, make a new commit on top of your original one that introduces a compromise. + +[setup] + +echo "The bikeshed should be ???" > proposal +git add . +git commit -m "What do you think?" + +[setup friend1] + +git pull yours main +echo "The bikeshed should be green" > proposal +git commit -am "Green" + +[setup friend2] + +git pull yours main +echo "The bikeshed should be blue" > proposal +git commit -am "Blue" + +[win] + +# Your proposal is acceptable for friend1. +git show main:proposal | git grep green +# Your proposal is acceptable for friend2. +git show main:proposal | git grep blue diff --git a/levels/unused/it/files-move b/levels/unused/it/files-move new file mode 100644 index 0000000..8f65710 --- /dev/null +++ b/levels/unused/it/files-move @@ -0,0 +1,27 @@ +title = No sleep required +cards = file-new file-delete file-rename + +[description] + +Actually, you decide that you don't need any sleep. + +Because of that, you won't require a bed, and can build some other piece of furniture from the wood! + + +[setup] + +echo A yellow cupboard with lots of drawers. > cupboard +echo A really big yellow shelf. > shelf +echo A comfortable, yellow bed with yellow cushions. > bed + +[win] + +# Rename the bed into something else, and give it a new description! +NUM_FILES="$(ls | wc -l)" +! test -f bed && test "$NUM_FILES" -ge 3 && ! grep -r "yellow bed" . + +[congrats] + +Neat! It even still looks a bit comfortable! + +You head out, eager for your first lesson at time travel school! diff --git a/levels/unused/it/index-mv b/levels/unused/it/index-mv new file mode 100644 index 0000000..9ff7270 --- /dev/null +++ b/levels/unused/it/index-mv @@ -0,0 +1,26 @@ +title = Rename a file in the next commit +cards = add reset-file checkout-file mv commit + +[description] + +Other times, you might want to rename a file in the next commit. Use + + git mv [file] [new name] + +for that. The effect is very similar as if you had created a copy with a new name, and removed the old version. + +[setup] + +echo a > a +echo SPECIAL > b +echo x > c +git add . +git commit -m "Initial commit" +echo x > a +echo b >> b +git add b + +[win] + +# Make a commit where you rename the file b to "x". +test "$(git ls-tree --name-only main)" = "$(echo -e "a\nc\nx")" diff --git a/levels/unused/it/init b/levels/unused/it/init new file mode 100644 index 0000000..c76daa5 --- /dev/null +++ b/levels/unused/it/init @@ -0,0 +1,14 @@ +title = Welcome! +cards = init + +[description] + + +[setup] + +rm -rf .git + +[win] + +# Again, initialize your time machine! +test -d .git diff --git a/levels/unused/it/pull-push b/levels/unused/it/pull-push new file mode 100644 index 0000000..71ce61d --- /dev/null +++ b/levels/unused/it/pull-push @@ -0,0 +1,51 @@ +title = Helping each other +cards = checkout commit-auto reset-hard pull push + +[description] + +The events and timelines you see are always only what your own time machine knows about! + +Of course, time agents don't have to work alone! Here, your sidekick has already prepared a merge for you! You can use the "pull" card to transfer it to your own time machine. + +Then, add another event on top (what does Sam have for dinner?), and `push` the result, to transfer it back to your sidekick! + +You can only ever manipulate things in your own time machine (the one on the bottom). + +[setup yours] + +echo "Just woke up. Is hungry." > sam +git add . +git commit -m "The beginning" + +git checkout -b pancakes +echo "Had blueberry pancakes with maple syrup for breakfast." > sam +git add . +git commit -m "Pancakes!" + +git checkout -b muesli main +echo "Had muesli with oats and strawberries for breakfast." > sam +git add . +git commit -m "Muesli!" + +git checkout main + +git push -u sidekick main pancakes muesli + +[setup sidekick] + +git checkout main +git merge pancakes +git merge muesli + +echo "Had pancakes with strawberries for breakfast." > sam +git add . +git commit -m "Let's make this breakfast compromise" --author="Sidekick " + +[win sidekick] + +# Below main's parent, there is a rhombus: +git rev-parse main^^ && test "$(git rev-parse main^^1^)" = "$(git rev-parse main^^2^)" + +[congrats] + +In reality, in many cases, a lot of time agents work together to build a really good future together! :) diff --git a/levels/unused/it/remotes-add b/levels/unused/it/remotes-add new file mode 100644 index 0000000..db24b7d --- /dev/null +++ b/levels/unused/it/remotes-add @@ -0,0 +1,33 @@ +title = Adding a remote +cards = checkout + +[description] + +Let's work together with others! Your friend has their own repo at the URL `../friend` - you can add it using + + git remote add [name] [URL] + +where `[name]` is an arbitrary, short name you pick for the remote. + +When you've done that, you can get all commits from that remote using + + git pull friend + +There's a letter for you! + +[setup] + +git remote remove friend + +[setup friend] + +echo "I'm really committed to our friendship! <3" > love_letter +git add . +git commit -m "Write a letter" + +[win] + +# Add a remote that points to ../friend. +git remote -v | grep '../friend' +# Pull from the remote. +git show HEAD:love_letter | grep committed diff --git a/levels/unused/it/remotes-delete b/levels/unused/it/remotes-delete new file mode 100644 index 0000000..c026204 --- /dev/null +++ b/levels/unused/it/remotes-delete @@ -0,0 +1,23 @@ +title = Deleting and renaming a remote +cards = checkout + +[description] + +Here, you already have two remotes configured! You can list them using `git remote`. + +[setup] + +git remote rename friend frend + +[setup friend] + +[setup enemy] + +[win] + +# Rename the remote with the typo (using `git remote rename [old name] [new name]`) +git remote | grep friend +# The remote with the typo is gone. +! grep 'frend' <(git remote) +# Delete the remote you don't want to keep (using `git remote remove [remote]`) +! grep 'enemy' <(git remote) diff --git a/levels/unused/it/restore b/levels/unused/it/restore new file mode 100644 index 0000000..1f9961e --- /dev/null +++ b/levels/unused/it/restore @@ -0,0 +1,28 @@ +title = Looking into the past +cards = checkout-from + +[description] + +You've been working on your essay for a while. But you're not happy with the changes you've made recently. You want to go back to the version called "Best version"! + +No problem, you can use the `checkout` card to restore your essay from an older commit! + +[setup] + +echo "Initial version" > essay.txt +git add . +git commit -m "Initial commit" + +echo "Improved version" > essay.txt +git commit -a -m "Improved version" + +echo "Best version" > essay.txt +git commit -a -m "Best version" + +echo "Less-good version" > essay.txt +git commit -a -m "Less-good version" + +[win] + +# For nostalgic reasons, restore the very first backup you made! +diff essay.txt <(echo "Best version") diff --git a/levels/unused/it/split b/levels/unused/it/split new file mode 100644 index 0000000..274b792 --- /dev/null +++ b/levels/unused/it/split @@ -0,0 +1,26 @@ +title = Split a commit! +cards = checkout commit reset-hard reset add rebase-interactive rebase-continue show + +[description] + +Here, both changes happened in one commit! Split them to be in two commits instead. + +[setup] + +echo something > file1 +echo something else > file2 +git add . +git commit -m "Initial commit" + +echo this should happen first >> file1 +echo and this should happen after that >> file2 +git commit -am "Both together" + +echo this is some other change >> file1 +echo this is some other change >> file2 +git commit -am "Something else" + +[win] + +test "$(git diff-tree --no-commit-id --name-status -r main^)" = "M file2" && +test "$(git diff-tree --no-commit-id --name-status -r main~2)" = "M file1" diff --git a/levels/unused/it/steps b/levels/unused/it/steps new file mode 100644 index 0000000..cb84861 --- /dev/null +++ b/levels/unused/it/steps @@ -0,0 +1,23 @@ +title = One step after another +cards = checkout commit reset-hard add + +[description] + +Sometimes, you might want to record the order in which things changed, instead of making a single commit. + +What happened here? Make two commits from the changes (using the "add" card), in an order that makes sense! + +[setup] + +echo something > file1 +echo something else > file2 +git add . +git commit -m "Initial commit" + +echo this should happen first >> file1 +echo and this should happen after that >> file2 + +[win] + +test "$(git diff-tree --no-commit-id --name-status -r main)" = "M file2" && +test "$(git diff-tree --no-commit-id --name-status -r main^)" = "M file1" diff --git a/levels/unused/it/who-are-you b/levels/unused/it/who-are-you new file mode 100644 index 0000000..f06137c --- /dev/null +++ b/levels/unused/it/who-are-you @@ -0,0 +1,23 @@ +title = Nice to meet you! +cards = config-name config-email + +[description] + +Introduce yourself using + + git config --global user.name Firstname + git config --global user.email "your@mail.com" + +[setup] + +[actions] + +test "$(git config user.name)" != "You" && hint "Hey $(git config user.name), nice to meet you!" + +[win] + +# Have a name configured. +test "$(git config user.name)" != "You" + +# Have an email address configured. +test "$(git config user.email)" != "you@time.agency" diff --git a/levels/workflows/gitignore b/levels/workflows/en/gitignore similarity index 100% rename from levels/workflows/gitignore rename to levels/workflows/en/gitignore diff --git a/levels/workflows/pr b/levels/workflows/en/pr similarity index 65% rename from levels/workflows/pr rename to levels/workflows/en/pr index 2496c1f..1c72510 100644 --- a/levels/workflows/pr +++ b/levels/workflows/en/pr @@ -3,8 +3,7 @@ cards = clone commit-auto reset-hard checkout file-new branch [description] -Your friend has a problem! Clone the repo located in `../friend`, create a branch called "solution", and fix the problem in this branch. When you're ready, make a "Pull Request" by using `git tag pr`. - +Your friend has a problem! Clone the repo, create a branch called "solution", and fix the problem in this branch. When you're ready, make a "Pull Request" by using `git tag pr`. [setup] diff --git a/levels/workflows/it/gitignore b/levels/workflows/it/gitignore new file mode 100644 index 0000000..dc55243 --- /dev/null +++ b/levels/workflows/it/gitignore @@ -0,0 +1,18 @@ +title = Ignoring files + +[description] + +That chicken is running around a lot, and changing often. We don't want to have it in our commits. + +Add it to the file .gitignore, and try using `git add .`! + +[setup] + +touch .gitignore +echo important > important +git add important +git commit -m "Initial commit" + +[actions] + +echo "$RANDOM" > chicken diff --git a/levels/workflows/it/pr b/levels/workflows/it/pr new file mode 100644 index 0000000..98fa95f --- /dev/null +++ b/levels/workflows/it/pr @@ -0,0 +1,25 @@ +title = Clonare un repo +cards = clone commit-auto reset-hard checkout file-new branch + +[description] + +Il tuo amico ha un problema! Clona il repo, crea una branch chiamata "solution" e aggiusta il problema in qulla branch. Quando sei pronto crea una "Pull Request" usando `git tag pr`. + +[setup] + +rm -rf .git + +[setup friend] + +echo "2 + 3 = " > file +git add . +git commit -m "Commit iniziale" + +[actions friend] + +git ls-remote yours | grep pr && git fetch yours && git merge yours/solution +git show main:file | grep 5 && hint "Grazie!" + +[win friend] + +git show main:file | grep 5 diff --git a/locale/babelrc b/locale/babelrc new file mode 100644 index 0000000..b2125de --- /dev/null +++ b/locale/babelrc @@ -0,0 +1,5 @@ +[python: **.gd] +encoding = utf-8 + +[godot_scene: **.tscn] +encoding = utf-8 diff --git a/locale/cards.pot b/locale/cards.pot new file mode 100644 index 0000000..a157bab --- /dev/null +++ b/locale/cards.pot @@ -0,0 +1,169 @@ +# Translations template for PROJECT. +# Copyright (C) 2022 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# Automatically generated, 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2022-08-18 10:39+0200\n" +"PO-Revision-Date: 2022-08-19 16:52+0200\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Generated-By: Babel 2.10.3\n" +"X-Generator: Poedit 3.1\n" + +#: CARDS DESCRIPTION oh-my-git/resources/cards.json:6 +msgid "Drag this card into the empty space above to initialize the time machine!" +msgstr "" + +#: oh-my-git/resources/cards.json:14 +msgid "Create your own copy of someone else's repo." +msgstr "" + +#: oh-my-git/resources/cards.json:22 +msgid "" +"Set your name.\n" +"\n" +"(Will not change anything outside of this game.)" +msgstr "" + +#: oh-my-git/resources/cards.json:30 +msgid "Set your email address." +msgstr "" + +#: oh-my-git/resources/cards.json:38 +msgid "Drag this card to a commit or to a branch to travel to it!" +msgstr "" + +#: oh-my-git/resources/cards.json:46 +msgid "Reset changes in a local file." +msgstr "" + +#: oh-my-git/resources/cards.json:54 +msgid "Get the file contents from the specified commits, and reset both the working directory, as well as the index, to it." +msgstr "" + +#: oh-my-git/resources/cards.json:62 +msgid "" +"Make a new commit, after automatically adding all changes to the index.\n" +"You'll be asked to enter a short description of what you changed." +msgstr "" + +#: oh-my-git/resources/cards.json:70 +msgid "Make a new commit containing your current environment! Type in a description of what changed!" +msgstr "" + +#: oh-my-git/resources/cards.json:78 +msgid "Merge the specified timeline into yours. If necessary, will create a merge commit." +msgstr "" + +#: oh-my-git/resources/cards.json:86 +msgid "Abort the current merge attempt, and reconstruct the previous state." +msgstr "" + +#: oh-my-git/resources/cards.json:94 +msgid "Put the events in your current timeline on top of the specified one." +msgstr "" + +#: oh-my-git/resources/cards.json:102 +msgid "Get someone else's version of the current timeline, and try to merge it into yours." +msgstr "" + +#: oh-my-git/resources/cards.json:110 +msgid "Get a someone else's version of the current timeline." +msgstr "" + +#: oh-my-git/resources/cards.json:118 +msgid "Give the current timeline to someone else." +msgstr "" + +#: oh-my-git/resources/cards.json:126 +msgid "Make changes to the events in your current timeline, back to the commit you drag this to." +msgstr "" + +#: oh-my-git/resources/cards.json:134 +msgid "Continue the current rebasing process." +msgstr "" + +#: oh-my-git/resources/cards.json:142 +msgid "Move the branch you're on to the specified commit." +msgstr "" + +#: oh-my-git/resources/cards.json:150 +msgid "Jump to the commit, and update the index. Keep the current environment." +msgstr "" + +#: oh-my-git/resources/cards.json:158 +msgid "Reset the index version of a file to the version in the commit you're on." +msgstr "" + +#: oh-my-git/resources/cards.json:166 +msgid "Repeat the specified action on top of your current timeline." +msgstr "" + +#: oh-my-git/resources/cards.json:174 +msgid "Make a new commit that reverts the changes of the speicified commit." +msgstr "" + +#: oh-my-git/resources/cards.json:182 +msgid "Start looking for the commit where things got bad." +msgstr "" + +#: oh-my-git/resources/cards.json:190 +msgid "State that the current commit is good! When you're automatically transferred, keep playing the `good` and `bad` cards!" +msgstr "" + +#: oh-my-git/resources/cards.json:198 +msgid "State that the current commit is bad! When you're automatically transferred, keep playing the `good` and `bad` cards!" +msgstr "" + +#: oh-my-git/resources/cards.json:206 +msgid "Update the index version of the file to its current real content." +msgstr "" + +#: oh-my-git/resources/cards.json:214 +msgid "Delete a file both in the working directory, as well as the index." +msgstr "" + +#: oh-my-git/resources/cards.json:222 +msgid "Make a commit from the current index." +msgstr "" + +#: oh-my-git/resources/cards.json:230 +msgid "Show what changed in the commit." +msgstr "" + +#: oh-my-git/resources/cards.json:238 +msgid "Create a new branch at your current location." +msgstr "" + +#: oh-my-git/resources/cards.json:246 +msgid "Delete a branch." +msgstr "" + +#: oh-my-git/resources/cards.json:254 +msgid "Display a log of where the ref pointed to in the past." +msgstr "" + +#: oh-my-git/resources/cards.json:262 +msgid "Create a new file." +msgstr "" + +#: oh-my-git/resources/cards.json:270 +msgid "Delete a file." +msgstr "" + +#: oh-my-git/resources/cards.json:278 +msgid "Rename a file." +msgstr "" + +#: oh-my-git/resources/cards.json:286 +msgid "Make a copy of a file." +msgstr "" diff --git a/locale/it_IT/it_IT-cards.po b/locale/it_IT/it_IT-cards.po new file mode 100644 index 0000000..409d345 --- /dev/null +++ b/locale/it_IT/it_IT-cards.po @@ -0,0 +1,174 @@ +# Translations template for PROJECT. +# Copyright (C) 2022 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# Automatically generated, 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2022-08-18 10:39+0200\n" +"PO-Revision-Date: 2022-08-19 14:48+0200\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Generated-By: Babel 2.10.3\n" +"X-Generator: Poedit 3.1\n" + +#: CARDS DESCRIPTION oh-my-git/resources/cards.json:6 +msgid "Drag this card into the empty space above to initialize the time machine!" +msgstr "Trascina questa carta nell'area vuota sopra per inizializzare la macchina del tempo!" + +#: oh-my-git/resources/cards.json:14 +msgid "Create your own copy of someone else's repo." +msgstr "Crea la tua copia personale del Repo di qualcun'altro." + +#: oh-my-git/resources/cards.json:22 +msgid "" +"Set your name.\n" +"\n" +"(Will not change anything outside of this game.)" +msgstr "" +"Imposta il tuo nome.\n" +"\n" +"(Non cambierà nulla all'infuori del gioco.)" + +#: oh-my-git/resources/cards.json:30 +msgid "Set your email address." +msgstr "Imposta la tua e-mail." + +#: oh-my-git/resources/cards.json:38 +msgid "Drag this card to a commit or to a branch to travel to it!" +msgstr "Trascina questa carta su un commit o su un branch per spostarti su di esso.!" + +#: oh-my-git/resources/cards.json:46 +msgid "Reset changes in a local file." +msgstr "Resetta i cambiamenti in un file locale." + +#: oh-my-git/resources/cards.json:54 +msgid "Get the file contents from the specified commits, and reset both the working directory, as well as the index, to it." +msgstr "Ottieni il contenuto dei file dai commit specificati e resetta sia la directory di lavoro sia l'indice." + +#: oh-my-git/resources/cards.json:62 +msgid "" +"Make a new commit, after automatically adding all changes to the index.\n" +"You'll be asked to enter a short description of what you changed." +msgstr "" +"Crea un nuovo commit, dopo aver aggiunto automaticamente tutti i cambiamenti all'indice.\n" +"Dovrai inserire una breve descrizione di cosa hai cambiato." + +#: oh-my-git/resources/cards.json:70 +msgid "Make a new commit containing your current environment! Type in a description of what changed!" +msgstr "Crea un commit contenente il tuo ambiente attuale! Scrivi una descrizione di cosa è cambiato!" + +#: oh-my-git/resources/cards.json:78 +msgid "Merge the specified timeline into yours. If necessary, will create a merge commit." +msgstr "Unisce la linea temporale specificata con la tua. Se necessario, creerà un commit di merge." + +#: oh-my-git/resources/cards.json:86 +msgid "Abort the current merge attempt, and reconstruct the previous state." +msgstr "Interrompe il corrente tentativo di unione e ricostruisce lo stato precedente." + +#: oh-my-git/resources/cards.json:94 +msgid "Put the events in your current timeline on top of the specified one." +msgstr "Mette gli eventi della tua linea temporale corrente sulla linea temporale specificata." + +#: oh-my-git/resources/cards.json:102 +msgid "Get someone else's version of the current timeline, and try to merge it into yours." +msgstr "Prende la versione di qualcun'altro della temporale corrente e prova ad unirla alla tua." + +#: oh-my-git/resources/cards.json:110 +msgid "Get a someone else's version of the current timeline." +msgstr "Prende la versione di qualcun'altro della temporale corrente." + +#: oh-my-git/resources/cards.json:118 +msgid "Give the current timeline to someone else." +msgstr "Invia la linea temporale corrente a qualcun'altro." + +#: oh-my-git/resources/cards.json:126 +msgid "Make changes to the events in your current timeline, back to the commit you drag this to." +msgstr "Cambia gli eventi della linea temporale fino al commit su cui hai trascinato questa scheda." + +#: oh-my-git/resources/cards.json:134 +msgid "Continue the current rebasing process." +msgstr "Continua il processo di rebasing." + +#: oh-my-git/resources/cards.json:142 +msgid "Move the branch you're on to the specified commit." +msgstr "Sposta il branch su cui ti trovi al commit specificato." + +#: oh-my-git/resources/cards.json:150 +msgid "Jump to the commit, and update the index. Keep the current environment." +msgstr "Salta al commit e aggiorna l'indice. Mantieni l'ambiente attuale." + +#: oh-my-git/resources/cards.json:158 +msgid "Reset the index version of a file to the version in the commit you're on." +msgstr "Resetta la versione dell'indice di un file alla versione del commit in cui sei." + +#: oh-my-git/resources/cards.json:166 +msgid "Repeat the specified action on top of your current timeline." +msgstr "Ripete l'azione specificata, in cima alla linea temporale corrente." + +#: oh-my-git/resources/cards.json:174 +msgid "Make a new commit that reverts the changes of the speicified commit." +msgstr "Crea un nuovo commit che annulla le modifiche del commit specificato." + +#: oh-my-git/resources/cards.json:182 +msgid "Start looking for the commit where things got bad." +msgstr "Inizia a cercare il commit dove le cose sono andate storte." + +#: oh-my-git/resources/cards.json:190 +msgid "State that the current commit is good! When you're automatically transferred, keep playing the `good` and `bad` cards!" +msgstr "Dichiara che l'attuale commit è buono! Continua a giocare con le carte `buono` e `cattivo`!" + +#: oh-my-git/resources/cards.json:198 +msgid "State that the current commit is bad! When you're automatically transferred, keep playing the `good` and `bad` cards!" +msgstr "Dichiara che l'attuale commit non è valido! Continua a giocare con le carte `buone` e `cattive`!" + +#: oh-my-git/resources/cards.json:206 +msgid "Update the index version of the file to its current real content." +msgstr "Aggiorna la versione in indice del file con il contenuto attuale." + +#: oh-my-git/resources/cards.json:214 +msgid "Delete a file both in the working directory, as well as the index." +msgstr "Cancella un file sia dalla cartella di lavoro corrente che dall'indice." + +#: oh-my-git/resources/cards.json:222 +msgid "Make a commit from the current index." +msgstr "Crea un commit dall'indice corrente." + +#: oh-my-git/resources/cards.json:230 +msgid "Show what changed in the commit." +msgstr "Mostra cosa è cambiato nel commit." + +#: oh-my-git/resources/cards.json:238 +msgid "Create a new branch at your current location." +msgstr "Crea un nuovo branch alla posizione corrente." + +#: oh-my-git/resources/cards.json:246 +msgid "Delete a branch." +msgstr "Cancella un branch." + +#: oh-my-git/resources/cards.json:254 +msgid "Display a log of where the ref pointed to in the past." +msgstr "Mostra un log di dove il riferimento (ref) ha puntato in passato." + +#: oh-my-git/resources/cards.json:262 +msgid "Create a new file." +msgstr "Crea un nuovo file." + +#: oh-my-git/resources/cards.json:270 +msgid "Delete a file." +msgstr "Cancella un file." + +#: oh-my-git/resources/cards.json:278 +msgid "Rename a file." +msgstr "Rinomina un file." + +#: oh-my-git/resources/cards.json:286 +msgid "Make a copy of a file." +msgstr "Crea una copia di un file." diff --git a/locale/it_IT/it_IT-text.po b/locale/it_IT/it_IT-text.po new file mode 100644 index 0000000..4dff1c8 --- /dev/null +++ b/locale/it_IT/it_IT-text.po @@ -0,0 +1,213 @@ +# Translations template for PROJECT. +# Copyright (C) 2022 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# Automatically generated, 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2022-08-18 10:39+0200\n" +"PO-Revision-Date: 2022-08-19 14:46+0200\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Generated-By: Babel 2.10.3\n" +"X-Generator: Poedit 3.1\n" + +msgid "teacher" +msgstr "insegnante" + +#: oh-my-git/scenes/arrow.tscn:35 oh-my-git/scenes/arrow.tscn:48 +#: oh-my-git/scenes/card.tscn:125 oh-my-git/scenes/card.tscn:144 +#: oh-my-git/scenes/cards.gd:58 +msgid "These are your cards! Drag them to highlighted areas to play them!" +msgstr "Queste sono le tue carte! Spostale nell'area evidenziata per usarle!" + +#: oh-my-git/scenes/cards.tscn:34 +msgid "Draw new cards" +msgstr "Pesca nuove carte" + +#: oh-my-git/scenes/cards.tscn:48 oh-my-git/scenes/file_browser.tscn:51 +msgid "title" +msgstr "titolo" + +#: oh-my-git/scenes/file_browser.tscn:64 oh-my-git/scenes/file_browser.tscn:70 +#: oh-my-git/scenes/file_browser.tscn:111 oh-my-git/scenes/text_editor.tscn:32 +msgid "Save" +msgstr "Salva" + +#: oh-my-git/scenes/file_browser.tscn:126 oh-my-git/scenes/text_editor.tscn:47 +#: oh-my-git/scenes/file_browser_item.tscn:118 +msgid "filename" +msgstr "nome file" + +#: oh-my-git/scenes/game.gd:3 +msgid "English" +msgstr "Inglese" + +#: oh-my-git/scenes/game.gd:3 +msgid "Italian" +msgstr "Italiano" + +#: oh-my-git/scenes/level.gd:45 +msgid "" +"Good job, you solved the level!\n" +"Feel free to try a few more things or click 'Next level'." +msgstr "" +"Ottimo lavoro, hai risolto il livello!\n" +" Sentiti libero di provare qualche altra cosa o clicca su 'Prossimo livello'." + +#: oh-my-git/scenes/level.gd:81 +msgid "Complete the goal of this level" +msgstr "Completa l'obbiettivo di questo ivello" + +#: oh-my-git/scenes/level_select.gd:60 +msgid "You get a golden badge for each level you solve without using the playing cards! Can you solve them all using the command line?" +msgstr "Ti aggiudicherai un badge d'oro per ogni livello che risolverai senza usare le cards! Puoi risolverli usando solo la linea di comando?" + +#: oh-my-git/scenes/level_select.tscn:51 +msgid "" +"Help us improving Oh My Git! by\n" +"answering some questions:" +msgstr "" +"Aiutaci a migliorare Oh My Git!\n" +"Rispondendo ad alcune domande:" + +#: oh-my-git/scenes/level_select.tscn:65 oh-my-git/scenes/survey.tscn:105 +msgid "To the survey /o/" +msgstr "Al sondaggio /o/" + +#: oh-my-git/scenes/level_select.tscn:82 oh-my-git/scenes/main.tscn:214 +msgid "Back" +msgstr "Indietro" + +#: oh-my-git/scenes/level_select.tscn:93 oh-my-git/scenes/main.tscn:225 +msgid "Reload" +msgstr "Ricarica" + +#: oh-my-git/scenes/main.tscn:105 oh-my-git/scenes/main.tscn:124 +#: oh-my-git/scenes/main.tscn:136 oh-my-git/scenes/main.tscn:237 +msgid "Cards!" +msgstr "Carte!" + +#: oh-my-git/scenes/main.tscn:249 +msgid "Tip!" +msgstr "Mancia!" + +#: oh-my-git/scenes/main.tscn:275 +msgid "Next level" +msgstr "Prossimo livello" + +#: oh-my-git/scenes/music_button.tscn:12 +msgid "Toggle music" +msgstr "Musica" + +#: oh-my-git/scenes/no_git.tscn:33 oh-my-git/scenes/survey.tscn:46 +#: oh-my-git/scenes/title.tscn:25 oh-my-git/scenes/no_git.tscn:46 +#: oh-my-git/scenes/title.tscn:38 oh-my-git/scenes/no_git.tscn:65 +#: oh-my-git/scenes/title.tscn:56 +msgid "Levels" +msgstr "Livelli" + +#: oh-my-git/scenes/no_git.tscn:71 oh-my-git/scenes/title.tscn:62 +msgid "Sandbox" +msgstr "Sandbox" + +#: oh-my-git/scenes/no_git.tscn:76 +msgid "Install" +msgstr "Installa" + +#: oh-my-git/scenes/no_git.tscn:97 oh-my-git/scenes/node.gd:83 +msgid "You can drag these around with your mouse!" +msgstr "Puoi trascinarli in giro con il mouse!" + +#: oh-my-git/scenes/node.tscn:55 oh-my-git/scenes/notification.gd:5 +#: oh-my-git/scenes/notification.tscn:59 +msgid "Got it!" +msgstr "Fatto!" + +#: oh-my-git/scenes/notification.gd:6 +msgid "Interesting!" +msgstr "Interessante!" + +#: oh-my-git/scenes/notification.gd:7 +msgid "Very useful!" +msgstr "Veramente utile!" + +#: oh-my-git/scenes/notification.gd:8 +msgid "Cool!" +msgstr "Bello!" + +#: oh-my-git/scenes/notification.gd:9 +msgid "Nice!" +msgstr "Bene!" + +#: oh-my-git/scenes/notification.gd:10 +msgid "Thanks!" +msgstr "Grazie!" + +#: oh-my-git/scenes/notification.gd:11 +msgid "Whatever..." +msgstr "Ad ogni costo..." + +#: oh-my-git/scenes/notification.gd:12 +msgid "Okay!" +msgstr "Ok!" + +#: oh-my-git/scenes/notification.gd:13 +msgid "Yay!" +msgstr "Yay!" + +#: oh-my-git/scenes/notification.gd:14 +msgid "Awesome!" +msgstr "Eccezionale!" + +#: oh-my-git/scenes/notification.tscn:37 +msgid "This is a hint! This is a hint! This is a hint! This is a hint! This is a hint! This is a hint! This is a hint! This is a hint! This is a hint!" +msgstr "Questo è un suggerimento! Questo è un suggerimento! Questo è un suggerimento! Questo è un suggerimento! Questo è un suggerimento! Questo è un suggerimento! Questo è un suggerimento! Questo è un suggerimento! Questo è un suggerimento!" + +#: oh-my-git/scenes/notification.tscn:59 oh-my-git/scenes/repository.gd:92 +msgid "This is the time machine of another person! To interact with it, you need special commands!" +msgstr "Questa è la macchina del tempo di u'altra persona! Per interagirci hai bisogno di comandi speciali!" + +#: oh-my-git/scenes/repository.tscn:56 oh-my-git/scenes/repository.tscn:67 +#: oh-my-git/scenes/repository.tscn:78 +msgid "Update" +msgstr "Aggiorna" + +#: oh-my-git/scenes/repository.tscn:93 +msgid "Hide trees and blobs" +msgstr "Nascondi alberi e macchie" + +#: oh-my-git/scenes/survey.tscn:34 oh-my-git/scenes/survey.tscn:71 +#: oh-my-git/scenes/title.tscn:68 +msgid "Quit" +msgstr "Esci" + +#: oh-my-git/scenes/survey.tscn:90 +msgid "" +"Thank you very much for playing!\n" +"Please help us improve Oh My Git! \n" +"by filling out this survey:" +msgstr "" +"Grazie mille per aver giocato!\n" +"Aiutaci a migliorare Oh My Git!\n" +"compilando questo sondaggio:" + +#: oh-my-git/scenes/terminal.gd:107 +msgid "This is your terminal! All commands are executed here, and you can see their output. You can also type your own commands here!" +msgstr "Questo è il tuo terminale! Tutti i comandi sono eseguiti qui e puoi vedere il loro output. Puoi anche digitare i tuoi comandi qui!" + +#: oh-my-git/scenes/terminal.tscn:86 oh-my-git/scenes/terminal.tscn:93 +#: oh-my-git/scenes/terminal.tscn:100 oh-my-git/scenes/text_editor.tscn:12 +msgid "Text here" +msgstr "Il testo qui" + +#: oh-my-git/scenes/title.tscn:68 oh-my-git/scenes/title.tscn:74 +msgid "Language" +msgstr "Linguaggio" diff --git a/locale/text.pot b/locale/text.pot new file mode 100644 index 0000000..3a74517 --- /dev/null +++ b/locale/text.pot @@ -0,0 +1,206 @@ +# Translations template for PROJECT. +# Copyright (C) 2022 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# Automatically generated, 2022. +# +msgid "" +msgstr "" +"Project-Id-Version: PROJECT VERSION\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2022-08-18 10:39+0200\n" +"PO-Revision-Date: 2022-08-19 16:52+0200\n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: it\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Generated-By: Babel 2.10.3\n" +"X-Generator: Poedit 3.1\n" + +msgid "teacher" +msgstr "" + +#: oh-my-git/scenes/arrow.tscn:35 oh-my-git/scenes/arrow.tscn:48 +#: oh-my-git/scenes/card.tscn:125 oh-my-git/scenes/card.tscn:144 +#: oh-my-git/scenes/cards.gd:58 +msgid "These are your cards! Drag them to highlighted areas to play them!" +msgstr "" + +#: oh-my-git/scenes/cards.tscn:34 +msgid "Draw new cards" +msgstr "" + +#: oh-my-git/scenes/cards.tscn:48 oh-my-git/scenes/file_browser.tscn:51 +msgid "title" +msgstr "" + +#: oh-my-git/scenes/file_browser.tscn:64 oh-my-git/scenes/file_browser.tscn:70 +#: oh-my-git/scenes/file_browser.tscn:111 oh-my-git/scenes/text_editor.tscn:32 +msgid "Save" +msgstr "" + +#: oh-my-git/scenes/file_browser.tscn:126 oh-my-git/scenes/text_editor.tscn:47 +#: oh-my-git/scenes/file_browser_item.tscn:118 +msgid "filename" +msgstr "" + +#: oh-my-git/scenes/game.gd:3 +msgid "English" +msgstr "" + +#: oh-my-git/scenes/game.gd:3 +msgid "Italian" +msgstr "" + +#: oh-my-git/scenes/level.gd:45 +msgid "" +"Good job, you solved the level!\n" +"Feel free to try a few more things or click 'Next level'." +msgstr "" + +#: oh-my-git/scenes/level.gd:81 +msgid "Complete the goal of this level" +msgstr "" + +#: oh-my-git/scenes/level_select.gd:60 +msgid "You get a golden badge for each level you solve without using the playing cards! Can you solve them all using the command line?" +msgstr "" + +#: oh-my-git/scenes/level_select.tscn:51 +msgid "" +"Help us improving Oh My Git! by\n" +"answering some questions:" +msgstr "" + +#: oh-my-git/scenes/level_select.tscn:65 oh-my-git/scenes/survey.tscn:105 +msgid "To the survey /o/" +msgstr "" + +#: oh-my-git/scenes/level_select.tscn:82 oh-my-git/scenes/main.tscn:214 +msgid "Back" +msgstr "" + +#: oh-my-git/scenes/level_select.tscn:93 oh-my-git/scenes/main.tscn:225 +msgid "Reload" +msgstr "" + +#: oh-my-git/scenes/main.tscn:105 oh-my-git/scenes/main.tscn:124 +#: oh-my-git/scenes/main.tscn:136 oh-my-git/scenes/main.tscn:237 +msgid "Cards!" +msgstr "" + +#: oh-my-git/scenes/main.tscn:249 +msgid "Tip!" +msgstr "" + +#: oh-my-git/scenes/main.tscn:275 +msgid "Next level" +msgstr "" + +#: oh-my-git/scenes/music_button.tscn:12 +msgid "Toggle music" +msgstr "" + +#: oh-my-git/scenes/no_git.tscn:33 oh-my-git/scenes/survey.tscn:46 +#: oh-my-git/scenes/title.tscn:25 oh-my-git/scenes/no_git.tscn:46 +#: oh-my-git/scenes/title.tscn:38 oh-my-git/scenes/no_git.tscn:65 +#: oh-my-git/scenes/title.tscn:56 +msgid "Levels" +msgstr "" + +#: oh-my-git/scenes/no_git.tscn:71 oh-my-git/scenes/title.tscn:62 +msgid "Sandbox" +msgstr "" + +#: oh-my-git/scenes/no_git.tscn:76 +msgid "Install" +msgstr "" + +#: oh-my-git/scenes/no_git.tscn:97 oh-my-git/scenes/node.gd:83 +msgid "You can drag these around with your mouse!" +msgstr "" + +#: oh-my-git/scenes/node.tscn:55 oh-my-git/scenes/notification.gd:5 +#: oh-my-git/scenes/notification.tscn:59 +msgid "Got it!" +msgstr "" + +#: oh-my-git/scenes/notification.gd:6 +msgid "Interesting!" +msgstr "" + +#: oh-my-git/scenes/notification.gd:7 +msgid "Very useful!" +msgstr "" + +#: oh-my-git/scenes/notification.gd:8 +msgid "Cool!" +msgstr "" + +#: oh-my-git/scenes/notification.gd:9 +msgid "Nice!" +msgstr "" + +#: oh-my-git/scenes/notification.gd:10 +msgid "Thanks!" +msgstr "" + +#: oh-my-git/scenes/notification.gd:11 +msgid "Whatever..." +msgstr "" + +#: oh-my-git/scenes/notification.gd:12 +msgid "Okay!" +msgstr "" + +#: oh-my-git/scenes/notification.gd:13 +msgid "Yay!" +msgstr "" + +#: oh-my-git/scenes/notification.gd:14 +msgid "Awesome!" +msgstr "" + +#: oh-my-git/scenes/notification.tscn:37 +msgid "This is a hint! This is a hint! This is a hint! This is a hint! This is a hint! This is a hint! This is a hint! This is a hint! This is a hint!" +msgstr "" + +#: oh-my-git/scenes/notification.tscn:59 oh-my-git/scenes/repository.gd:92 +msgid "This is the time machine of another person! To interact with it, you need special commands!" +msgstr "" + +#: oh-my-git/scenes/repository.tscn:56 oh-my-git/scenes/repository.tscn:67 +#: oh-my-git/scenes/repository.tscn:78 +msgid "Update" +msgstr "" + +#: oh-my-git/scenes/repository.tscn:93 +msgid "Hide trees and blobs" +msgstr "" + +#: oh-my-git/scenes/survey.tscn:34 oh-my-git/scenes/survey.tscn:71 +#: oh-my-git/scenes/title.tscn:68 +msgid "Quit" +msgstr "" + +#: oh-my-git/scenes/survey.tscn:90 +msgid "" +"Thank you very much for playing!\n" +"Please help us improve Oh My Git! \n" +"by filling out this survey:" +msgstr "" + +#: oh-my-git/scenes/terminal.gd:107 +msgid "This is your terminal! All commands are executed here, and you can see their output. You can also type your own commands here!" +msgstr "" + +#: oh-my-git/scenes/terminal.tscn:86 oh-my-git/scenes/terminal.tscn:93 +#: oh-my-git/scenes/terminal.tscn:100 oh-my-git/scenes/text_editor.tscn:12 +msgid "Text here" +msgstr "" + +#: oh-my-git/scenes/title.tscn:68 oh-my-git/scenes/title.tscn:74 +msgid "Language" +msgstr "" diff --git a/nodes/blob.svg.import b/nodes/blob.svg.import index 725b562..bcb068a 100644 --- a/nodes/blob.svg.import +++ b/nodes/blob.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/nodes/commit.svg.import b/nodes/commit.svg.import index d47ebc6..86b4574 100644 --- a/nodes/commit.svg.import +++ b/nodes/commit.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/nodes/document.svg.import b/nodes/document.svg.import index 4c5b739..d038a7f 100644 --- a/nodes/document.svg.import +++ b/nodes/document.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/nodes/head.svg.import b/nodes/head.svg.import index f011619..db9e9e9 100644 --- a/nodes/head.svg.import +++ b/nodes/head.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/nodes/head1.svg.import b/nodes/head1.svg.import index 0888d00..6ad89b1 100644 --- a/nodes/head1.svg.import +++ b/nodes/head1.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/nodes/head2.svg.import b/nodes/head2.svg.import index 92a04d2..f1fd364 100644 --- a/nodes/head2.svg.import +++ b/nodes/head2.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/nodes/head3.svg.import b/nodes/head3.svg.import index 7ba33f4..1641097 100644 --- a/nodes/head3.svg.import +++ b/nodes/head3.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/nodes/ref.svg.import b/nodes/ref.svg.import index 1ad858d..a7b3421 100644 --- a/nodes/ref.svg.import +++ b/nodes/ref.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/nodes/tree.svg.import b/nodes/tree.svg.import index 8192b20..f613eaf 100644 --- a/nodes/tree.svg.import +++ b/nodes/tree.svg.import @@ -28,6 +28,7 @@ process/fix_alpha_border=true process/premult_alpha=false process/HDR_as_SRGB=false process/invert_color=false +process/normal_map_invert_y=false stream=false size_limit=0 detect_3d=true diff --git a/project.godot b/project.godot index 8af698d..fa90c90 100644 --- a/project.godot +++ b/project.godot @@ -81,26 +81,26 @@ window/stretch/aspect="keep" left={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } right={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } up={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } down={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null) -, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"physical_scancode":0,"unicode":0,"echo":false,"script":null) +, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } click={ @@ -125,30 +125,35 @@ right_click={ } tab_complete={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777218,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } save={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":true,"meta":false,"command":true,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":true,"meta":false,"command":true,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } delete_word={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":true,"meta":false,"command":true,"pressed":false,"scancode":87,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":true,"meta":false,"command":true,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } clear={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":true,"meta":false,"command":true,"pressed":false,"scancode":76,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":true,"meta":false,"command":true,"pressed":false,"scancode":76,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } mute={ "deadzone": 0.5, -"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":77,"unicode":0,"echo":false,"script":null) +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":77,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } +[locale] + +translations=PoolStringArray( "res://locale/it_IT/it_IT-cards.po", "res://locale/it_IT/it_IT-text.po" ) +locale_filter=[ 0, [ ] ] + [network] limits/debugger_stdout/max_chars_per_second=100000 diff --git a/resources/cards.json b/resources/cards.json index 631a7e5..6a0ffa5 100644 --- a/resources/cards.json +++ b/resources/cards.json @@ -1,7 +1,7 @@ [ { - "id": "init", - "command": "git init", + "id": "init", + "command": "git init", "description": "Drag this card into the empty space above to initialize the time machine!" }, { diff --git a/scenes/Language.gd b/scenes/Language.gd new file mode 100644 index 0000000..2f94fbf --- /dev/null +++ b/scenes/Language.gd @@ -0,0 +1,35 @@ +extends MenuButton + + +func _ready(): + make_popup_menu() # generate items for popup menu + get_popup().connect("id_pressed", self, "_on_item_pressed") + check_current_items() + + +func make_popup_menu(): + for lang in game.languages.values(): + get_popup().add_check_item(lang) + + +func check_current_items(): + var items_count = get_popup().get_item_count() + for i in range(items_count): + var idx = get_popup().get_item_index(i) + if get_popup().get_item_text(idx) == game.languages[game.os_lang]: + get_popup().set_item_checked(idx, true) + else: + get_popup().set_item_checked(idx, false) + + +func _on_item_pressed(id): + #get_popup().set_item_checked(id, true) + var lang = get_popup().get_item_text(id) + for key in game.languages.keys(): + var value = tr(game.languages[key]) + if value == lang: + game.os_lang = key +# game.levels_dir = "res://levels/" + key + + check_current_items() + TranslationServer.set_locale(game.os_lang) diff --git a/scenes/arrow.tscn b/scenes/arrow.tscn index 53c1d62..27ca701 100644 --- a/scenes/arrow.tscn +++ b/scenes/arrow.tscn @@ -30,8 +30,8 @@ margin_left = -19.374 margin_top = -5.93085 margin_right = 20.626 margin_bottom = 8.06915 -custom_fonts/font = ExtResource( 1 ) custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_fonts/font = ExtResource( 1 ) text = "label" align = 1 __meta__ = { @@ -43,10 +43,7 @@ margin_left = -230.84 margin_top = 42.1225 margin_right = 231.16 margin_bottom = 68.1225 -custom_fonts/font = ExtResource( 1 ) custom_colors/font_color = Color( 0.356863, 0.356863, 0.356863, 1 ) +custom_fonts/font = ExtResource( 1 ) text = "label" align = 1 -__meta__ = { -"_edit_use_anchors_": false -} diff --git a/scenes/card.tscn b/scenes/card.tscn index 55c230f..9de01e4 100644 --- a/scenes/card.tscn +++ b/scenes/card.tscn @@ -170,5 +170,6 @@ stretch_mode = 6 __meta__ = { "_edit_use_anchors_": false } + [connection signal="mouse_entered" from="Area2D" to="." method="_mouse_entered"] [connection signal="mouse_exited" from="Area2D" to="." method="_mouse_exited"] diff --git a/scenes/cards.gd b/scenes/cards.gd index 4448d6c..aeb360c 100644 --- a/scenes/cards.gd +++ b/scenes/cards.gd @@ -39,7 +39,8 @@ func draw_card(card): new_card.id = card["id"] new_card.command = card["command"] - new_card.description = card["description"] + # TODO: Make better game.os_lang + "_" + game.os_lang.to_upper() + new_card.description = tr(card["description"]) new_card.energy = 0 #card.energy new_card.position = Vector2(rect_size.x, rect_size.y*2) add_child(new_card) @@ -55,7 +56,7 @@ func draw(ids): arrange_cards() if ids.size() > 0: - game.notify("These are your cards! Drag them to highlighted areas to play them!", self, "cards") + game.notify(tr("These are your cards! Drag them to highlighted areas to play them!"), self, "cards") func arrange_cards(): var t = Timer.new() diff --git a/scenes/cards.tscn b/scenes/cards.tscn index 1fc2fcc..dbade8d 100644 --- a/scenes/cards.tscn +++ b/scenes/cards.tscn @@ -9,9 +9,6 @@ anchor_right = 1.0 anchor_bottom = 1.0 mouse_filter = 2 script = ExtResource( 3 ) -__meta__ = { -"_edit_use_anchors_": false -} [node name="ColorRect" type="ColorRect" parent="."] anchor_right = 1.0 @@ -49,4 +46,5 @@ text = "3" __meta__ = { "_edit_use_anchors_": false } + [connection signal="pressed" from="Button" to="." method="redraw_all_cards"] diff --git a/scenes/chapter.gd b/scenes/chapter.gd index 9f2abc2..f6f09d1 100644 --- a/scenes/chapter.gd +++ b/scenes/chapter.gd @@ -8,12 +8,14 @@ var levels func load(path): levels = [] - var parts = path.split("/") - slug = parts[parts.size()-1] +# var parts = path.split("/") +# slug = parts[parts.size()-1] + slug = path var level_names = [] var dir = Directory.new() - dir.open("res://levels/%s" % slug) +# dir.open(game.levels_dir + "/%s" % slug) + dir.open(game.levels_dir + "/" + path + "/" + game.os_lang + "/") dir.list_dir_begin() while true: @@ -28,7 +30,8 @@ func load(path): var final_level_sequence = [] - var level_sequence = Array(helpers.read_file("res://levels/%s/sequence" % slug, "").split("\n")) +# var level_sequence = Array(helpers.read_file(game.levels_dir + "/%s/sequence" % slug, "").split("\n")) + var level_sequence = Array(helpers.read_file(game.levels_dir + "/" + path + "/sequence").split("\n")) for level in level_sequence: if level == "": @@ -42,7 +45,8 @@ func load(path): for l in final_level_sequence: var level = Level.new() - level.load("res://levels/%s/%s" % [slug, l]) +# level.load(game.levels_dir + "/%s/%s" % [slug, l]) + level.load(game.levels_dir + "/" + path + "/" + game.os_lang + "/" + l) levels.push_back(level) func _to_string(): diff --git a/scenes/cli_badge.tscn b/scenes/cli_badge.tscn index 740e2a3..37bbb26 100644 --- a/scenes/cli_badge.tscn +++ b/scenes/cli_badge.tscn @@ -32,9 +32,6 @@ texture = ExtResource( 1 ) expand = true stretch_mode = 6 script = ExtResource( 2 ) -__meta__ = { -"_edit_use_anchors_": false -} [node name="Particles2D" type="Particles2D" parent="."] show_behind_parent = true diff --git a/scenes/drop_area.tscn b/scenes/drop_area.tscn index ed564e6..9326dc4 100644 --- a/scenes/drop_area.tscn +++ b/scenes/drop_area.tscn @@ -23,16 +23,14 @@ resource_local_to_scene = true shader = SubResource( 2 ) shader_param/hovered = 0.0 -[node name="DropArea" type="Node2D" groups=[ -"drop_areas", -]] +[node name="DropArea" type="Node2D" groups=["drop_areas"]] position = Vector2( -0.197731, 0.0673599 ) script = ExtResource( 1 ) [node name="Area2D" type="Area2D" parent="."] -input_pickable = false collision_layer = 0 collision_mask = 524288 +input_pickable = false [node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] shape = SubResource( 1 ) @@ -45,5 +43,6 @@ material = SubResource( 3 ) position = Vector2( -0.102825, -0.377726 ) scale = Vector2( 2.25501, 2.25501 ) texture = ExtResource( 2 ) + [connection signal="area_entered" from="Area2D" to="." method="_mouse_entered"] [connection signal="area_exited" from="Area2D" to="." method="_mouse_exited"] diff --git a/scenes/file_browser.gd b/scenes/file_browser.gd index 1af3fa2..b2d45f0 100644 --- a/scenes/file_browser.gd +++ b/scenes/file_browser.gd @@ -82,7 +82,7 @@ func update(): grid.add_child(item) if files.size() > 0: - game.notify("Click on these files to edit them!", self, "file-browser") + game.notify("EDIT_FILE", self, "file-browser") if false: match mode: diff --git a/scenes/file_browser.tscn b/scenes/file_browser.tscn index cbc6bec..e10ad1a 100644 --- a/scenes/file_browser.tscn +++ b/scenes/file_browser.tscn @@ -4,17 +4,12 @@ [ext_resource path="res://fonts/default.tres" type="DynamicFont" id=2] [ext_resource path="res://styles/theme.tres" type="Theme" id=3] -[node name="FileBrowser" type="Control" groups=[ -"editors", -]] +[node name="FileBrowser" type="Control" groups=["editors"]] anchor_right = 1.0 anchor_bottom = 1.0 rect_min_size = Vector2( 0, 142 ) theme = ExtResource( 3 ) script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} [node name="Panel" type="Panel" parent="."] anchor_right = 1.0 @@ -53,19 +48,19 @@ align = 1 [node name="Breadcrumbs" type="HBoxContainer" parent="Panel/Margin/Rows"] visible = false -margin_right = 1856.0 +margin_right = 1904.0 margin_bottom = 50.0 rect_min_size = Vector2( 0, 50 ) custom_constants/separation = 8 [node name="Button" type="Button" parent="Panel/Margin/Rows/Breadcrumbs"] -margin_right = 55.0 +margin_right = 61.0 margin_bottom = 50.0 text = "root" [node name="Button2" type="Button" parent="Panel/Margin/Rows/Breadcrumbs"] -margin_left = 63.0 -margin_right = 104.0 +margin_left = 69.0 +margin_right = 114.0 margin_bottom = 50.0 text = "dir" @@ -131,5 +126,6 @@ __meta__ = { [node name="PopupMenu" type="PopupMenu" parent="."] margin_right = 20.0 margin_bottom = 20.0 + [connection signal="pressed" from="Panel/TextEdit/SaveButton" to="." method="save"] [connection signal="pressed" from="Panel/TextEdit/CloseButton" to="." method="close"] diff --git a/scenes/file_browser_item.tscn b/scenes/file_browser_item.tscn index d623e75..6a8149d 100644 --- a/scenes/file_browser_item.tscn +++ b/scenes/file_browser_item.tscn @@ -13,9 +13,6 @@ margin_bottom = -0.0800018 rect_min_size = Vector2( 140, 140 ) mouse_filter = 1 script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} [node name="Control" type="Control" parent="."] anchor_left = 0.5 @@ -122,4 +119,5 @@ autowrap = true [node name="PopupMenu" type="PopupMenu" parent="."] margin_right = 20.0 margin_bottom = 20.0 + [connection signal="id_pressed" from="PopupMenu" to="." method="_popup_menu_pressed"] diff --git a/scenes/game.gd b/scenes/game.gd index 2f2a0b5..7249cb2 100644 --- a/scenes/game.gd +++ b/scenes/game.gd @@ -1,5 +1,9 @@ extends Node +var languages = {"en": tr("English"), "it": tr("Italian")} # Localizations allowed +var os_lang = OS.get_locale_language() # Variable for game localization (it, en, ecc...) +var levels_dir = "res://levels" + var tmp_prefix = OS.get_user_data_dir() + "/tmp/" var global_shell var fake_editor @@ -18,6 +22,10 @@ var state = {} var mutex func _ready(): + # Check if language traslation exist otherwise use the default language + if not languages.keys().has(os_lang): + os_lang = "en" + mutex = Mutex.new() load_state() @@ -119,7 +127,7 @@ func notify(text, target=null, hint_slug=null): return var notification = preload("res://scenes/notification.tscn").instance() - notification.text = text + notification.text = tr(text) if not target: target = get_tree().root target.call_deferred("add_child", notification) diff --git a/scenes/input_dialog.tscn b/scenes/input_dialog.tscn index 17876b9..4642eed 100644 --- a/scenes/input_dialog.tscn +++ b/scenes/input_dialog.tscn @@ -21,4 +21,5 @@ anchor_bottom = 1.0 __meta__ = { "_edit_use_anchors_": false } + [connection signal="text_entered" from="LineEdit" to="." method="_text_entered"] diff --git a/scenes/level.gd b/scenes/level.gd index 97c1746..bb9ba30 100644 --- a/scenes/level.gd +++ b/scenes/level.gd @@ -78,7 +78,7 @@ func load(path): else: repo = "yours" - var desc = "Complete the goal of this level" + var desc = tr("Complete the goal of this level") for line in Array(config[k].split("\n")): if line.length() > 0 and line[0] == "#": desc = line.substr(1).strip_edges(true, true) diff --git a/scenes/level_select.gd b/scenes/level_select.gd index acd0866..98526e1 100644 --- a/scenes/level_select.gd +++ b/scenes/level_select.gd @@ -15,6 +15,7 @@ func back(): func reload(): + for child in level_list.get_children(): child.queue_free() @@ -56,14 +57,7 @@ func reload(): level_list.add_child(hb) if badge.active: - game.notify("You get a golden badge for each level you solve without using the playing cards! Can you solve them all using the command line?", badge, "cli-badge") + game.notify(tr("You get a golden badge for each level you solve without using the playing cards! Can you solve them all using the command line?"), badge, "cli-badge") level_id += 1 chapter_id += 1 - - - - - - - diff --git a/scenes/level_select.tscn b/scenes/level_select.tscn index 2f8e4f3..69629da 100644 --- a/scenes/level_select.tscn +++ b/scenes/level_select.tscn @@ -17,9 +17,6 @@ anchor_right = 1.0 anchor_bottom = 1.0 theme = ExtResource( 1 ) script = ExtResource( 2 ) -__meta__ = { -"_edit_use_anchors_": false -} [node name="ScrollContainer" type="ScrollContainer" parent="."] anchor_right = 1.0 @@ -42,35 +39,11 @@ margin_right = 1320.0 margin_bottom = 1080.0 size_flags_horizontal = 3 -[node name="Button" type="Button" parent="."] -margin_left = 61.0902 -margin_top = 59.0538 -margin_right = 126.09 -margin_bottom = 98.0538 -text = "Back" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Button2" type="Button" parent="."] -margin_left = 138.588 -margin_top = 59.3009 -margin_right = 226.588 -margin_bottom = 98.3009 -focus_mode = 0 -enabled_focus_mode = 0 -text = "Reload" -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="Button3" parent="." instance=ExtResource( 4 )] - [node name="HelpLabel" type="Label" parent="."] visible = false margin_left = 63.0 margin_top = 159.0 -margin_right = 378.0 +margin_right = 379.0 margin_bottom = 220.0 text = "Help us improving Oh My Git! by answering some questions:" @@ -90,6 +63,41 @@ text = "To the survey /o/" __meta__ = { "_edit_use_anchors_": false } -[connection signal="pressed" from="Button" to="." method="back"] -[connection signal="pressed" from="Button2" to="." method="reload"] + +[node name="HBoxContainer" type="HBoxContainer" parent="."] +anchor_right = 1.0 +margin_left = 89.0 +margin_top = 24.0 +margin_bottom = 63.0 +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Back" type="Button" parent="HBoxContainer"] +margin_right = 65.0 +margin_bottom = 39.0 +text = "Back" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Reload" type="Button" parent="HBoxContainer"] +margin_left = 70.0 +margin_right = 158.0 +margin_bottom = 39.0 +focus_mode = 0 +enabled_focus_mode = 0 +text = "Reload" +__meta__ = { +"_edit_use_anchors_": false +} + +[node name="Toggle_Music" parent="HBoxContainer" instance=ExtResource( 4 )] +margin_left = 163.0 +margin_top = 0.0 +margin_right = 309.0 +margin_bottom = 39.0 + [connection signal="pressed" from="HelpLabel/Button3" to="." method="onSurveyPressed"] +[connection signal="pressed" from="HBoxContainer/Back" to="." method="back"] +[connection signal="pressed" from="HBoxContainer/Reload" to="." method="reload"] diff --git a/scenes/levels.gd b/scenes/levels.gd index 593b728..8485ecf 100644 --- a/scenes/levels.gd +++ b/scenes/levels.gd @@ -9,11 +9,11 @@ func reload(): chapters = [] var dir = Directory.new() - dir.open("res://levels") + dir.open(game.levels_dir) dir.list_dir_begin() var chapter_names = [] - + while true: var file = dir.get_next() if file == "": @@ -26,7 +26,7 @@ func reload(): var final_chapter_sequence = [] - var chapter_sequence = Array(helpers.read_file("res://levels/sequence", "").split("\n")) + var chapter_sequence = Array(helpers.read_file(game.levels_dir + "/sequence", "").split("\n")) for chapter in chapter_sequence: if chapter == "": @@ -40,5 +40,6 @@ func reload(): for c in final_chapter_sequence: var chapter = Chapter.new() - chapter.load("res://levels/%s" % c) +# chapter.load(game.levels_dir + "/" + c + "/" + game.os_lang) + chapter.load(c) chapters.push_back(chapter) diff --git a/scenes/main.tscn b/scenes/main.tscn index e19dec2..18c9ba4 100644 --- a/scenes/main.tscn +++ b/scenes/main.tscn @@ -36,9 +36,6 @@ margin_bottom = -8.0 mouse_filter = 2 theme = ExtResource( 6 ) script = ExtResource( 2 ) -__meta__ = { -"_edit_use_anchors_": false -} [node name="CanvasLayer" type="CanvasLayer" parent="."] layer = -1 @@ -122,9 +119,6 @@ size_flags_vertical = 3 bbcode_enabled = true bbcode_text = "Level description here!" text = "Level description here!" -__meta__ = { -"_edit_use_anchors_": false -} [node name="LevelCongrats" type="RichTextLabel" parent="Rows/Columns/RightSide/LevelInfo/LevelPanel/Text"] visible = false @@ -189,9 +183,9 @@ position = Vector2( 68.6342, 59.1206 ) script = ExtResource( 9 ) [node name="Area2D" type="Area2D" parent="Cursor"] -input_pickable = false collision_layer = 524288 collision_mask = 0 +input_pickable = false [node name="CollisionShape2D" type="CollisionShape2D" parent="Cursor/Area2D"] shape = SubResource( 1 ) @@ -202,11 +196,8 @@ margin_top = 5.13129 margin_right = 636.864 margin_bottom = 44.1313 custom_constants/separation = 8 -__meta__ = { -"_edit_use_anchors_": false -} -[node name="BackButton" type="Button" parent="Menu"] +[node name="Back" type="Button" parent="Menu"] margin_right = 65.0 margin_bottom = 39.0 focus_mode = 0 @@ -216,7 +207,7 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="ReloadButton2" type="Button" parent="Menu"] +[node name="Reload" type="Button" parent="Menu"] margin_left = 73.0 margin_right = 161.0 margin_bottom = 39.0 @@ -229,8 +220,8 @@ __meta__ = { [node name="CardsButton" type="Button" parent="Menu"] visible = false -margin_left = 458.0 -margin_right = 539.0 +margin_left = 169.0 +margin_right = 250.0 margin_bottom = 39.0 focus_mode = 0 enabled_focus_mode = 0 @@ -251,7 +242,7 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Button3" parent="Menu" instance=ExtResource( 11 )] +[node name="Toogle_Music" parent="Menu" instance=ExtResource( 11 )] margin_left = 169.0 margin_top = 0.0 margin_right = 315.0 @@ -276,10 +267,11 @@ text = "Next level" __meta__ = { "_edit_use_anchors_": false } + [connection signal="saved" from="Rows/Columns/RightSide/FileBrowser" to="." method="update_repos"] [connection signal="command_done" from="Rows/Controls/Terminal" to="." method="update_repos"] -[connection signal="pressed" from="Menu/BackButton" to="." method="back"] -[connection signal="pressed" from="Menu/ReloadButton2" to="." method="reload_level"] +[connection signal="pressed" from="Menu/Back" to="." method="back"] +[connection signal="pressed" from="Menu/Reload" to="." method="reload_level"] [connection signal="pressed" from="Menu/CardsButton" to="." method="toggle_cards"] [connection signal="pressed" from="Menu/Tip!" to="." method="new_tip"] [connection signal="pressed" from="Menu/NextLevelButton" to="." method="load_next_level"] diff --git a/scenes/music_button.gd b/scenes/music_button.gd index 6cc4e03..330356a 100644 --- a/scenes/music_button.gd +++ b/scenes/music_button.gd @@ -1,6 +1,5 @@ extends Button - func _ready(): pass diff --git a/scenes/music_button.tscn b/scenes/music_button.tscn index 70f47b0..fae6457 100644 --- a/scenes/music_button.tscn +++ b/scenes/music_button.tscn @@ -2,7 +2,7 @@ [ext_resource path="res://scenes/music_button.gd" type="Script" id=1] -[node name="Button3" type="Button"] +[node name="Toggle_music" type="Button"] margin_left = 241.005 margin_top = 58.856 margin_right = 387.005 @@ -11,7 +11,5 @@ focus_mode = 0 enabled_focus_mode = 0 text = "Toggle music" script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} + [connection signal="pressed" from="." to="." method="toggle_music"] diff --git a/scenes/no_git.tscn b/scenes/no_git.tscn index b4cad7c..61f5db1 100644 --- a/scenes/no_git.tscn +++ b/scenes/no_git.tscn @@ -28,8 +28,8 @@ margin_left = 797.196 margin_top = 545.117 margin_right = 1138.2 margin_bottom = 601.117 -custom_fonts/font = ExtResource( 5 ) custom_colors/font_color = Color( 0.533333, 0.392157, 0.392157, 1 ) +custom_fonts/font = ExtResource( 5 ) text = "by bleeptrack & blinry" align = 1 __meta__ = { @@ -41,8 +41,8 @@ margin_left = 716.131 margin_top = 572.398 margin_right = 1216.13 margin_bottom = 628.398 -custom_fonts/font = ExtResource( 5 ) custom_colors/font_color = Color( 0.533333, 0.392157, 0.392157, 1 ) +custom_fonts/font = ExtResource( 5 ) text = "Original score by winniehell" align = 1 __meta__ = { @@ -58,7 +58,7 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Button" type="Button" parent="VBoxContainer"] +[node name="Levels" type="Button" parent="VBoxContainer"] visible = false margin_right = 351.0 margin_bottom = 39.0 @@ -70,10 +70,10 @@ margin_right = 351.0 margin_bottom = 39.0 text = "Sandbox" -[node name="Button2" type="Button" parent="VBoxContainer"] +[node name="Install" type="Button" parent="VBoxContainer"] margin_right = 351.0 margin_bottom = 39.0 -text = "Sure, I'll install it!" +text = "Install" [node name="Sprite" type="Sprite" parent="."] @@ -94,12 +94,12 @@ margin_left = 20.0 margin_top = 21.0 margin_right = 546.0 margin_bottom = 252.0 -text = "Hi! It seems that you don't have Git installed yet! - -On Linux, please install it from your package manager, usually the package is called \"git\"! - -On macOS 10.8 and below, you can download Git from git-scm.com." +text = "GIT_MESSAGE" autowrap = true -[connection signal="pressed" from="VBoxContainer/Button" to="." method="levels"] +__meta__ = { +"_edit_use_anchors_": false +} + +[connection signal="pressed" from="VBoxContainer/Levels" to="." method="levels"] [connection signal="pressed" from="VBoxContainer/Button3" to="." method="sandbox"] -[connection signal="pressed" from="VBoxContainer/Button2" to="." method="quit"] +[connection signal="pressed" from="VBoxContainer/Install" to="." method="quit"] diff --git a/scenes/node.gd b/scenes/node.gd index f19e66a..c695e91 100644 --- a/scenes/node.gd +++ b/scenes/node.gd @@ -80,7 +80,7 @@ func type_set(new_type): $Sprite.texture = preload("res://nodes/tree.svg") "commit": $Sprite.texture = preload("res://nodes/commit.svg") - game.notify("You can drag these around with your mouse!", self, "drag-nodes") + game.notify(tr("You can drag these around with your mouse!"), self, "drag-nodes") "tag": $Sprite.texture = preload("res://nodes/blob.svg") "ref": diff --git a/scenes/node.tscn b/scenes/node.tscn index 643a44c..0905cc2 100644 --- a/scenes/node.tscn +++ b/scenes/node.tscn @@ -50,8 +50,8 @@ margin_left = -19.9265 margin_top = -12.0097 margin_right = 129.073 margin_bottom = 40.9903 -custom_fonts/font = ExtResource( 1 ) custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_fonts/font = ExtResource( 1 ) text = "object_id" __meta__ = { "_edit_use_anchors_": false @@ -75,12 +75,13 @@ margin_left = -22.057 margin_top = 31.1738 margin_right = -12.057 margin_bottom = 66.1738 -custom_styles/normal = SubResource( 2 ) -custom_fonts/font = ExtResource( 1 ) custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_fonts/font = ExtResource( 1 ) +custom_styles/normal = SubResource( 2 ) __meta__ = { "_edit_use_anchors_": false } + [connection signal="mouse_entered" from="Rect" to="." method="_on_hover"] [connection signal="mouse_exited" from="Rect" to="." method="_on_unhover"] [connection signal="mouse_entered" from="Area2D" to="." method="_on_hover"] diff --git a/scenes/notification.gd b/scenes/notification.gd index 8825be2..e668c49 100644 --- a/scenes/notification.gd +++ b/scenes/notification.gd @@ -1,7 +1,17 @@ extends Node2D var text setget _set_text -var button_texts = ["Got it!", "Interesting!", "Very useful!", "Cool!", "Nice!", "Thanks!", "Whatever...", "Okay!", "Yay!", "Awesome!"] +var button_texts = [ + tr("Got it!"), + tr("Interesting!"), + tr("Very useful!"), + tr("Cool!"), + tr("Nice!"), + tr("Thanks!"), + tr("Whatever..."), + tr("Okay!"), + tr("Yay!"), + tr("Awesome!") ] func _ready(): button_texts.shuffle() diff --git a/scenes/notification.tscn b/scenes/notification.tscn index 5d944e0..0068983 100644 --- a/scenes/notification.tscn +++ b/scenes/notification.tscn @@ -22,9 +22,6 @@ margin_right = 492.0 margin_bottom = 170.0 theme = ExtResource( 2 ) custom_styles/panel = SubResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} [node name="Label" type="Label" parent="Panel"] anchor_right = 1.0 @@ -36,9 +33,6 @@ margin_bottom = -15.0 custom_fonts/font = ExtResource( 1 ) text = "This is a hint! This is a hint! This is a hint! This is a hint! This is a hint! This is a hint! This is a hint! This is a hint! This is a hint!" autowrap = true -__meta__ = { -"_edit_use_anchors_": false -} [node name="CenterContainer" type="CenterContainer" parent="Panel"] anchor_top = 1.0 @@ -60,4 +54,5 @@ text = "Got it!" __meta__ = { "_edit_use_anchors_": false } + [connection signal="pressed" from="Panel/CenterContainer/OK" to="." method="confirm"] diff --git a/scenes/repository.gd b/scenes/repository.gd index 916bb03..00a9aeb 100644 --- a/scenes/repository.gd +++ b/scenes/repository.gd @@ -89,7 +89,7 @@ func set_label(new_label): $Rows/RepoVis/SeparatorLine/DropArea.queue_free() $Rows/RepoVis/SeparatorLine.hide() else: - game.notify("This is the time machine of another person! To interact with it, you need special commands!", self, "remote") + game.notify(tr("This is the time machine of another person! To interact with it, you need special commands!"), self, "remote") label_node.text = new_label func random_position(): diff --git a/scenes/repository.tscn b/scenes/repository.tscn index 566b5e8..476ffb0 100644 --- a/scenes/repository.tscn +++ b/scenes/repository.tscn @@ -12,9 +12,6 @@ rect_clip_content = true mouse_filter = 2 theme = ExtResource( 2 ) script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} [node name="Rows" type="HSplitContainer" parent="."] anchor_right = 1.0 @@ -38,9 +35,6 @@ anchor_bottom = 1.0 margin_top = -4.0 mouse_filter = 2 color = Color( 0.196078, 0.184314, 0.435294, 1 ) -__meta__ = { -"_edit_use_anchors_": false -} [node name="DropArea" parent="Rows/RepoVis/SeparatorLine" instance=ExtResource( 4 )] position = Vector2( 71.6342, -29.3427 ) @@ -54,9 +48,6 @@ margin_right = 229.063 margin_bottom = -8.50476 custom_fonts/font = ExtResource( 3 ) text = "Repo name" -__meta__ = { -"_edit_use_anchors_": false -} [node name="IndexLabel" type="Label" parent="Rows/RepoVis"] visible = false @@ -113,6 +104,7 @@ margin_bottom = 61.0 __meta__ = { "_edit_use_anchors_": false } + [connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"] [connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"] [connection signal="pressed" from="Rows/RepoVis/Button" to="." method="update_everything"] diff --git a/scenes/sandbox.tscn b/scenes/sandbox.tscn index ee28577..e0546a9 100644 --- a/scenes/sandbox.tscn +++ b/scenes/sandbox.tscn @@ -10,9 +10,6 @@ anchor_right = 1.0 anchor_bottom = 1.0 theme = ExtResource( 3 ) script = ExtResource( 4 ) -__meta__ = { -"_edit_use_anchors_": false -} [node name="Background" type="ColorRect" parent="."] anchor_right = 1.0 @@ -48,4 +45,5 @@ margin_left = 961.0 margin_right = 1910.0 margin_bottom = 1070.0 size_flags_horizontal = 3 + [connection signal="command_done" from="Columns/Terminal" to="." method="update_repo"] diff --git a/scenes/survey.tscn b/scenes/survey.tscn index 85aa1a1..2d3bfc1 100644 --- a/scenes/survey.tscn +++ b/scenes/survey.tscn @@ -13,9 +13,6 @@ anchor_right = 1.0 anchor_bottom = 1.0 theme = ExtResource( 1 ) script = ExtResource( 3 ) -__meta__ = { -"_edit_use_anchors_": false -} [node name="ColorRect" type="ColorRect" parent="."] anchor_right = 1.0 @@ -41,8 +38,8 @@ margin_left = 774.698 margin_top = 297.059 margin_right = 1115.7 margin_bottom = 353.059 -custom_fonts/font = ExtResource( 5 ) custom_colors/font_color = Color( 0.533333, 0.392157, 0.392157, 1 ) +custom_fonts/font = ExtResource( 5 ) text = "by bleeptrack & blinry" align = 1 __meta__ = { @@ -61,9 +58,6 @@ anchor_bottom = 1.0 margin_left = -175.997 margin_top = -183.0 margin_right = 175.997 -__meta__ = { -"_edit_use_anchors_": false -} [node name="Button2" type="Button" parent="VBoxContainer"] margin_right = 351.0 @@ -106,5 +100,6 @@ text = "To the survey /o/" __meta__ = { "_edit_use_anchors_": false } + [connection signal="pressed" from="VBoxContainer/Button2" to="." method="quit"] [connection signal="pressed" from="VBoxContainer2/Button" to="." method="on_survey_pressed"] diff --git a/scenes/terminal.gd b/scenes/terminal.gd index 5df56af..757df1e 100644 --- a/scenes/terminal.gd +++ b/scenes/terminal.gd @@ -104,7 +104,7 @@ func command_done(cmd): if cmd.output.length() <= 1000: output.text = output.text + "$ " + cmd.command + "\n" + cmd.output - game.notify("This is your terminal! All commands are executed here, and you can see their output. You can also type your own commands here!", self, "terminal") + game.notify(tr("This is your terminal! All commands are executed here, and you can see their output. You can also type your own commands here!"), self, "terminal") else: $Pager/Text.text = cmd.output $Pager.popup() diff --git a/scenes/terminal.tscn b/scenes/terminal.tscn index 2e8d6fa..8e36199 100644 --- a/scenes/terminal.tscn +++ b/scenes/terminal.tscn @@ -34,9 +34,6 @@ anchor_right = 1.0 anchor_bottom = 1.0 mouse_filter = 1 script = ExtResource( 4 ) -__meta__ = { -"_edit_use_anchors_": false -} [node name="Rows" type="VBoxContainer" parent="."] anchor_right = 1.0 @@ -56,12 +53,9 @@ anchor_bottom = 1.0 margin_top = -1.92206 margin_bottom = -1.92212 size_flags_vertical = 3 -custom_styles/normal = SubResource( 1 ) custom_fonts/normal_font = ExtResource( 3 ) +custom_styles/normal = SubResource( 1 ) scroll_following = true -__meta__ = { -"_edit_use_anchors_": false -} [node name="Completions" type="Tree" parent="Rows/TopHalf"] anchor_top = 1.0 @@ -147,6 +141,7 @@ volume_db = -10.0 [node name="OkSound" type="AudioStreamPlayer" parent="."] stream = ExtResource( 2 ) volume_db = -5.0 + [connection signal="item_selected" from="Rows/TopHalf/Completions" to="." method="_completion_selected"] [connection signal="pressed" from="Rows/VBoxContainer/Button" to="Rows/VBoxContainer/Button" method="pressed"] [connection signal="pressed" from="Rows/VBoxContainer/Button2" to="Rows/VBoxContainer/Button2" method="pressed"] diff --git a/scenes/text_editor.tscn b/scenes/text_editor.tscn index 732784f..1738b65 100644 --- a/scenes/text_editor.tscn +++ b/scenes/text_editor.tscn @@ -3,9 +3,7 @@ [ext_resource path="res://fonts/default.tres" type="DynamicFont" id=1] [ext_resource path="res://scenes/text_editor.gd" type="Script" id=2] -[node name="TextEditor" type="TextEdit" groups=[ -"editors", -]] +[node name="TextEditor" type="TextEdit" groups=["editors"]] anchor_right = 1.0 anchor_bottom = 1.0 custom_colors/background_color = Color( 0, 0, 0, 1 ) @@ -48,5 +46,6 @@ text = "x" __meta__ = { "_edit_use_anchors_": false } + [connection signal="pressed" from="SaveButton" to="." method="save"] [connection signal="pressed" from="CloseButton" to="." method="close"] diff --git a/scenes/title.gd b/scenes/title.gd index f2374af..a9674bf 100644 --- a/scenes/title.gd +++ b/scenes/title.gd @@ -1,13 +1,19 @@ extends Control + func _ready(): + #check_correct_lang_item() if !OS.has_feature("standalone") and !game.skipped_title: game.skipped_title = true get_tree().change_scene("res://scenes/level_select.tscn") + + #make_popup_items() + func quit(): get_tree().quit() + func levels(): get_tree().change_scene("res://scenes/level_select.tscn") diff --git a/scenes/title.tscn b/scenes/title.tscn index 8363e84..d247714 100644 --- a/scenes/title.tscn +++ b/scenes/title.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=5 format=2] +[gd_scene load_steps=6 format=2] [ext_resource path="res://styles/theme.tres" type="Theme" id=1] [ext_resource path="res://images/oh-my-git.png" type="Texture" id=2] [ext_resource path="res://scenes/title.gd" type="Script" id=3] +[ext_resource path="res://scenes/Language.gd" type="Script" id=4] [ext_resource path="res://fonts/default.tres" type="DynamicFont" id=5] [node name="Title" type="Control"] @@ -11,7 +12,8 @@ anchor_bottom = 1.0 theme = ExtResource( 1 ) script = ExtResource( 3 ) __meta__ = { -"_edit_use_anchors_": false +"_editor_description_": " +" } [node name="Label2" type="Label" parent="."] @@ -19,21 +21,18 @@ margin_left = 790.778 margin_top = 594.135 margin_right = 1131.78 margin_bottom = 650.135 -custom_fonts/font = ExtResource( 5 ) custom_colors/font_color = Color( 0.533333, 0.392157, 0.392157, 1 ) +custom_fonts/font = ExtResource( 5 ) text = "by bleeptrack & blinry" align = 1 -__meta__ = { -"_edit_use_anchors_": false -} [node name="Label3" type="Label" parent="."] margin_left = 709.713 margin_top = 621.416 margin_right = 1209.71 margin_bottom = 677.416 -custom_fonts/font = ExtResource( 5 ) custom_colors/font_color = Color( 0.533333, 0.392157, 0.392157, 1 ) +custom_fonts/font = ExtResource( 5 ) text = "Original score by winniehell" align = 1 __meta__ = { @@ -66,12 +65,21 @@ margin_right = 351.0 margin_bottom = 127.0 text = "Quit" +[node name="Language" type="MenuButton" parent="VBoxContainer"] +margin_top = 132.0 +margin_right = 351.0 +margin_bottom = 171.0 +text = "Language" +flat = false +script = ExtResource( 4 ) + [node name="Sprite" type="Sprite" parent="."] [node name="oh-my-git" type="Sprite" parent="Sprite"] position = Vector2( 967.924, 306.066 ) scale = Vector2( 0.320895, 0.320895 ) texture = ExtResource( 2 ) + [connection signal="pressed" from="VBoxContainer/Button" to="." method="levels"] [connection signal="pressed" from="VBoxContainer/Button3" to="." method="sandbox"] [connection signal="pressed" from="VBoxContainer/Button2" to="." method="quit"] diff --git a/styles/theme.tres b/styles/theme.tres index 35315aa..a56c333 100644 --- a/styles/theme.tres +++ b/styles/theme.tres @@ -193,7 +193,7 @@ Button/colors/font_color_disabled = Color( 0.9, 0.9, 0.9, 0.2 ) Button/colors/font_color_hover = Color( 0.94, 0.94, 0.94, 1 ) Button/colors/font_color_pressed = Color( 1, 1, 1, 1 ) Button/constants/hseparation = 2 -Button/fonts/font = null +Button/fonts/font = ExtResource( 1 ) Button/styles/disabled = SubResource( 1 ) Button/styles/focus = SubResource( 2 ) Button/styles/hover = SubResource( 3 ) @@ -206,7 +206,7 @@ CheckBox/colors/font_color_hover_pressed = Color( 1, 1, 1, 1 ) CheckBox/colors/font_color_pressed = Color( 1, 1, 1, 1 ) CheckBox/constants/check_vadjust = 0 CheckBox/constants/hseparation = 4 -CheckBox/fonts/font = null +CheckBox/fonts/font = ExtResource( 1 ) CheckBox/icons/checked = null CheckBox/icons/radio_checked = null CheckBox/icons/radio_unchecked = null @@ -238,7 +238,7 @@ PopupMenu/colors/font_color_disabled = Color( 0.4, 0.4, 0.4, 0.8 ) PopupMenu/colors/font_color_hover = Color( 0.88, 0.88, 0.88, 1 ) PopupMenu/constants/hseparation = 4 PopupMenu/constants/vseparation = 4 -PopupMenu/fonts/font = null +PopupMenu/fonts/font = ExtResource( 1 ) PopupMenu/icons/checked = null PopupMenu/icons/radio_checked = null PopupMenu/icons/radio_unchecked = null @@ -261,11 +261,11 @@ RichTextLabel/constants/shadow_offset_x = 1 RichTextLabel/constants/shadow_offset_y = 1 RichTextLabel/constants/table_hseparation = 3 RichTextLabel/constants/table_vseparation = 3 -RichTextLabel/fonts/bold_font = null -RichTextLabel/fonts/bold_italics_font = null -RichTextLabel/fonts/italics_font = null +RichTextLabel/fonts/bold_font = ExtResource( 1 ) +RichTextLabel/fonts/bold_italics_font = ExtResource( 1 ) +RichTextLabel/fonts/italics_font = ExtResource( 1 ) RichTextLabel/fonts/mono_font = ExtResource( 2 ) -RichTextLabel/fonts/normal_font = null +RichTextLabel/fonts/normal_font = ExtResource( 1 ) RichTextLabel/styles/focus = null RichTextLabel/styles/normal = null TextEdit/colors/background_color = Color( 0, 0, 0, 0 ) @@ -322,8 +322,8 @@ Tree/constants/item_margin = 0 Tree/constants/scroll_border = 4 Tree/constants/scroll_speed = 12 Tree/constants/vseparation = 4 -Tree/fonts/font = null -Tree/fonts/title_button_font = null +Tree/fonts/font = ExtResource( 1 ) +Tree/fonts/title_button_font = ExtResource( 1 ) Tree/icons/arrow = null Tree/icons/arrow_collapsed = null Tree/icons/checked = null