Skip to content

Commit

Permalink
Massive Code Cleanup - pt1 (#429)
Browse files Browse the repository at this point in the history
* Massive Code Cleanup - pt1

I've noticed that it'd be difficult to just make one big commit, so I'll make more smaller ones

* Added README for scripts and locales

* Minor big fix

* Delete .DS_Store
ZiClaud authored Jan 6, 2025
1 parent c8efdd9 commit e7f9a4c
Showing 7 changed files with 192 additions and 130 deletions.
1 change: 0 additions & 1 deletion background.js

This file was deleted.

13 changes: 7 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!--
<!--
Material You NewTab
Copyright (c) 2023-2025 XengShi
Licensed under the GNU General Public License v3.0 (GPL-3.0)
You should have received a copy of the GNU General Public License along with this program.
You should have received a copy of the GNU General Public License along with this program.
If not, see <https://www.gnu.org/licenses/>.
-->

@@ -19,7 +19,11 @@
<style id="iconStyle"></style>

<!-- SCRIPTS -->
<script src="preload.js"></script>
<script src="scripts/preload.js"></script>
<script defer src="scripts/languages.js"></script>
<script defer src="scripts/script.js"></script>

<!-- LANGUAGES SCRIPTS -->
<script src="locales/pt.js"></script>
<script src="locales/en.js"></script>
<script src="locales/es.js"></script>
@@ -40,9 +44,6 @@
<script src="locales/fr.js"></script>
<script src="locales/az.js"></script>
<script src="locales/sl.js"></script>
<script defer src="languages.js"></script>
<script defer src="script.js"></script>
<!-- <script defer src="languagesAnalysis.js"></script> -->

</head>

24 changes: 24 additions & 0 deletions locales/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Adding a New Translation

1. **Create a new translation file**
- Name the file using the appropriate language code (e.g., `de.js` for German or `ar.js` for Arabic).
- Place this file in the `locales` directory.

2. **Add the locale to `index.html`**
- Open `index.html` and locate the `<!-- LANGUAGES SCRIPTS -->` section.
- Add your new locale script tag in the correct order, as follows:
```html
<script src="locales/de.js"></script>
```

3. **Test the translation**
- Verify that your translations are displayed correctly when the respective locale is selected.

4. **Keep translations consistent**
- Follow the structure of existing translation files to ensure consistency across all locales.

5. **Subscribe to Translation Updates for Contributors** (optional)
- Join the #195 channel or mailing list to receive notifications about new lines being added to translations.

6. **Update the Currently Supported Languages section in the `README.md`**
- Add the new language to the list of supported languages in the README, following the existing format.
34 changes: 34 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Contributing to the Project

## Adding a New Feature

1. **Create a new script file**
- Name the file appropriately to reflect the feature you're adding. For example, if your feature involves animations, the file could be named `animation-feature.js`.
- Place this new file in the `scripts` directory.

2. **Include the copyright comment**
- Add the following copyright block at the top of your new script file:
```javascript
/*
* Material You NewTab
* Copyright (c) 2023-2025 XengShi
* Licensed under the GNU General Public License v3.0 (GPL-3.0)
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/
```

3. **Integrate the script into the project**
- Open `index.html` and locate the `<!-- SCRIPTS -->` section.
- Add your script as follows:
```html
<script defer src="scripts/animation-feature.js"></script>
```

4. **Develop your feature**
- Implement your functionality within the script. Write clean, maintainable code and follow any existing coding standards used in the project.

---

## Additional Notes
Ensure you've read the [code of conduct](../CODE_OF_CONDUCT.md) and the [contributing](../CONTRIBUTING.md).
File renamed without changes.
File renamed without changes.
250 changes: 127 additions & 123 deletions script.js → scripts/script.js

Large diffs are not rendered by default.

0 comments on commit e7f9a4c

Please sign in to comment.