Problemi con progetto

Linguaggi di programmazione: php, perl, python, C, bash e tutti gli altri.
Scrivi risposta
staibuz
Prode Principiante
Messaggi: 11
Iscrizione: martedì 22 ottobre 2019, 18:39
Distribuzione: Ubuntu 18.04.3 LTS
Sesso: Maschile

Problemi con progetto

Messaggio da staibuz »

Ciao a tutti,
sono un principiante nell'uso di Ubuntu e Linux in generale.
Il mio problema è questo sto cerando di creare un file .dll partendo da un file .cs seguendo le istruzioni pubblicate su Steam dall'autore della traduzione olandese.(che a sua volta ha seguito quelle della traduzione cinese).

In particolare di tratta della traduzione di cites skyline che vorrei pubblicare come mod su steam e a quanto pare si può fare solo come .dll

Vi allego le sue istruzioni.
Ho svolto tutti i punti elencati tranne il numero 6 (6. Creating a mod).
Le istruzioni su come creare una mod sono poco dettagliate per un principiante come il sottoscritto perciò come vedrete più in basso lanciando il comando make ottengo un errore.
Ho cercato in rete una soluzione ma non riesco a capire come risolvere.
Quindi chiedo un vostro aiuto.
Grazie.

Codice: Seleziona tutto

Cities Skylines translation tools.
----------------------------------



1. Introduction
---------------

Cities Skylines uses a proprietary file format for its language files. These
files are not human editable. Therefore, in order to translate the game into
more languages, tools are necessary to create and edit these files.

The library ColossalManaged.dll, that is shipped with Cities Skylines,
contains support to read and write .locale files. The consequence is that
it is almost a necessity to write tools in C#.

This package contains tools that allow you to convert from and to language
files. The tools are command-line tools, that must be run from a Windows
Command prompt or Linux shellj. I dislike GUI utilities because they cannot
be automated.

Translating consists of several steps:
   1. Convert an existing .locale file into a .po (gettext) file
   2. Edit the .po file
   3. Create a new .locale file from the original file and the .po file


2. Getting started
------------------

Extract this zip file in a directory and copy ColossalManaged.dll, into it. This
file comes with Cities Skylines and can be found in its installation directory.
Linux users will also have to install Mono. Most distributions contain Mono,
you can use zypper, yum or apt-get to install, i.e.:

zypper install mono

Dependencies have been avoided, so just the basic Mono installation is
sufficient.

3. Convert an existing .locale file into a .po (gettext) file
-------------------------------------------------------------

This is done with the tool locale2po. Open a command prompt or Linux shell and
cd to the directory where you have the tools available.

An example to convert the English locale file is:

Linux users:
    mono locale2po.exe -input en.locale -output en.po
Windows users:
    locale2po -input en.locale -output en.po

After executing the command the file en.po has been created.


4. Edit the .po file
--------------------

.po files are the GNU gettext format. The gettext format is a very common file
format for translating software. .po files can be edited with any text editor.
If you want to do this, open the .po file in a text editor and add your
translations to the msgstr lines. You have to leave the #. lines and the msgid
lines unmodified).

However, there exists also a lot of software to edit .po files. It is
recommended to use such software, because you will be able to translated much
faster (yes, really).

For now the only tested program is Lokalize, which is part of the KDE software
packages (don't worry, there is a Windows version). Other tools may also work
but please understand that the tools do not support all features of the gettext
file format. With Lokalize, the game can be quickly translated.


5. Create a new .locale file from the original file and the .po file
--------------------------------------------------------------------

This is done with the tool locale2po. Open a command prompt or Linux shell and
cd to the directory where you have the tools available.

An example to convert a Dutch language .po into locale file is:

Linux users:
    mono po2locale.exe -original en.locale -po nl.po -output export.locale -nativename 'NEDERLANDS' -englishname '(DUTCH)'
Windows users:
    po2locale -original en.locale -po nl.po -output export.locale -nativename "NEDERLANDS" -englishname "(DUTCH)"

After executing the command the file export.po has been created. You can copy
this into the games' locale directory and then you can select the new language
in the game.

The po2locale tool supports a few command line options:

  -original		This used to specify the original .locale file that you
                          converted into .po with locale2po.
  -po			This used to specify the .po file that you have edited
  -output		This used to specify the name of the .locale file that
                          needs to be created
  -nativename		This is the name of the language of the new .locale
			  file, as it is called in that language itself
  -englishname		This is the name of the language of the new .locale
                          file, as it is called in the English language
  -version		This is the version of the .locale fileformat to use.
                          The current version seems to be 2, and this is
                          the default.


6. Creating a mod
-----------------

Unfortunately, there is no official way to publish your language file into the
workshop, just like you can with assets, maps, colour corrections and styles.
The only solutions to clothe your language file as a mod. However, this
requires programming, increasing the amount of knowledge required to be able
to do it.

In the subdirectory Mod, you will find example files for creating a mod from
your language file. The following instructions assume a Linux system, because
I don't know how to do it on Windows.

The first step is to rename the file, for example if you are translating into
Bulgarian:

mv Mod_Lang_NL.cs Mod_Lang_BG.cs

Next step is to adjust the Makefile

Mod_Lang_NL.dll: Mod_Lang_NL.cs nl.locale
	mcs -target:library -r:ColossalManaged.dll -r:ICities.dll -r:Assembly-CSharp.dll -codepage:utf8 -resource:nl.locale,Mod_Lang_NL.nl.locale $<

... would become:

Mod_Lang_BG.dll: Mod_Lang_BG.cs bg.locale
	mcs -target:library -r:ColossalManaged.dll -r:ICities.dll -r:Assembly-CSharp.dll -codepage:utf8 -resource:bg.locale,Mod_Lang_BG.bg.locale $<

The next step is to adjust the Language codes at the start of the file:

namespace Mod_Lang_NL
{
	public class Mod_Lang_NL : IUserMod
	{
		private string locale_name = "nl";

... would become:

namespace Mod_Lang_BG
{
	public class Mod_Lang_BG : IUserMod
	{
		private string locale_name = "bg";


Now modify the mod names and descriptions at the bottom of the file, i.e.

                default:
                        return "Dutch localization Mod";

... would become:

                default:
                        return "Bulgarian localization Mod";

Copy the files Assembly-CSharp.dll  ColossalManaged.dll  ICities.dll from the
game directory to the mod source code directory.

Type "make", and if everything goes well, you mod will now be created and you
can publish your mod on the Steam Workshop.

The mod source code was originally written by the authors of the Traditional
Chinese translation. Please give their mod a visit and give it a positive vote:

http://steamcommunity.com/sharedfiles/filedetails/?id=417564312

I have made some improvements to the source code:
* It only installs the language file if it does not yet already exist, or if
  the file size is not correct
* The activation mechanism is through the OnEnabled method, which is a lot less
  ugly than through the Name method. This also means users can disable the mod
  inside the content manager of the game
* It is multi-lingual itself and will display the mod name and description in
  multiple languages.
Ho creato il Makefile

Codice: Seleziona tutto

Mod_Lang_IT.dll: Mod_Lang_IT.cs it.locale
	mcs -target:library -r:ColossalManaged.dll -r:ICities.dll -r:Assembly-CSharp.dll -codepage:utf8 -resource:it.locale,Mod_Lang_IT.it.locale $<
e il file .cs

Codice: Seleziona tutto

using ICities;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using ColossalFramework.Plugins;
using System.Reflection;

// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// !
// ! This mod is based on Chinese Traditional localization https://github.com/ccpz/cities-skylines-Mod_Lang_CHT
// ! Thank you a lot, Taiwanese creators!
// !
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

namespace Mod_Lang_IT
{
	public class Mod_Lang_IT : IUserMod
	{
		private string locale_name = "it";

		//
		//the following OS detect code is referring http://stackoverflow.com/questions/10138040/how-to-detect-properly-windows-linux-mac-operating-systems
		//
		public enum Platform
		{
			Windows,
			Linux,
			Mac
		}

		public static Platform RunningPlatform()
		{
			switch (Environment.OSVersion.Platform)
			{
			case PlatformID.Unix:
				// Well, there are chances MacOSX is reported as Unix instead of MacOSX.
				// Instead of platform check, we'll do a feature checks (Mac specific root folders)
				if (Directory.Exists("/Applications")
					& Directory.Exists("/System")
					& Directory.Exists("/Users")
					& Directory.Exists("/Volumes"))
					return Platform.Mac;
				else
					return Platform.Linux;

			case PlatformID.MacOSX:
				return Platform.Mac;

			default:
				return Platform.Windows;
			}
		}

		//------------------------------------------------------------
		// Create destination path to copy the locale file to
		//------------------------------------------------------------
		private string getDestinationPath()
		{
			String dst_path = "";
			#if (DEBUG)
			DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, String.Format("OS Type: {0}", RunningPlatform().ToString()));
			#endif
			switch (RunningPlatform())
			{
			case Platform.Windows:
				dst_path = "Files\\Locale\\" + locale_name + ".locale";
				break;
			case Platform.Mac:
				dst_path = "Cities.app/Contents/Resources/Files/Locale/" + locale_name + ".locale";
				break;
			case Platform.Linux:
				dst_path = "Files/Locale/" + locale_name + ".locale";
				break;
			}

			#if (DEBUG)
			DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, String.Format("Destination {0}", dst_path));
			#endif

			return dst_path;
		}

		//------------------------------------------------------------
		// Force to reload the locale manager
		//------------------------------------------------------------
		private void resetLocaleManager(String loc_name)
		{
			// Reload Locale Manager
			ColossalFramework.Globalization.LocaleManager.ForceReload();

			string[] locales = ColossalFramework.Globalization.LocaleManager.instance.supportedLocaleIDs;
			for (int i = 0; i < locales.Length; i++)
			{
				#if (DEBUG)
				DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, String.Format("Locale index: {0}, ID: {1}", i, locales[i]));
				#endif
				if (locales[i].Equals(loc_name))
				{
					#if (DEBUG)
					DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, String.Format("Find locale {0} at index: {1}", loc_name, i));
					#endif
					ColossalFramework.Globalization.LocaleManager.instance.LoadLocaleByIndex(i);

					//thanks to: https://github.com/Mesoptier/SkylineToolkit/commit/d33f0bae67662df25bdf8ee2170d95a6999c3721
					ColossalFramework.SavedString lang_setting = new ColossalFramework.SavedString("localeID", "gameSettings");
					#if (DEBUG)
					DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, String.Format("Current Language Setting: {0}", lang_setting.value));
					#endif
					lang_setting.value = locale_name;
					ColossalFramework.GameSettings.SaveAll();                                
					break;
				}
			}
		}

		//------------------------------------------------------------
		// Locale file size
		//------------------------------------------------------------
		private long LocaleFileSize() {
			Assembly asm = Assembly.GetExecutingAssembly();
			Stream src = asm.GetManifestResourceStream(asm.GetName().Name+"."+locale_name+".locale");
			long l = src.Length;
			src.Close();
			return l;
		}

		//------------------------------------------------------------
		// Copy the locale file
		//------------------------------------------------------------
		private void copyLocaleFile(String dst_path)
		{
			Assembly asm = Assembly.GetExecutingAssembly();
			Stream src = asm.GetManifestResourceStream(asm.GetName().Name+"."+locale_name+".locale");
			#if (DEBUG)
			DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, String.Format("File size: {0}", st.Length));
			#endif

			FileStream dst = File.Open(dst_path, FileMode.Create);

			byte[] buffer = new byte[8 * 1024];
			int len = 0;
			while ((len = src.Read(buffer, 0, buffer.Length)) > 0)
			{
				dst.Write(buffer, 0, len);
			}
			dst.Close();
			src.Close();
	
			#if (DEBUG)
			DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, String.Format("File write to: {0}", Path.GetFullPath(dst.Name)));
			#endif
		}

		//============================================================
		// Main
		//============================================================
		private void CopyLocaleAndReloadLocaleManager()
		{
			try
			{
				Boolean first_install = true;

				String dst_path = getDestinationPath();

				if ((dst_path.Length > 0) && File.Exists(dst_path))
				{
					FileInfo f = new FileInfo(dst_path);
					if (f.Length == LocaleFileSize())
					{
						#if (DEBUG)
						DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "Locale file is found, user has already used this mod before.");
						#endif
						first_install = false;
					}
				}
				if (first_install == true)
				{
					DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "Locale file for locale "+locale_name+
						" does not exist or has wrong file size. Installing file to "+dst_path);
					copyLocaleFile(dst_path);
					DebugOutputPanel.AddMessage(PluginManager.MessageType.Message, "Done, game language will now be switched to "+locale_name);
					resetLocaleManager(locale_name);
				}
			}
			catch (Exception e)
			{
//				#if (DEBUG)
				DebugOutputPanel.AddMessage(PluginManager.MessageType.Error, e.ToString());
//				#endif
			}
		}

		//============================================================
		// Modding API
		//============================================================
		public void OnEnabled() {
			CopyLocaleAndReloadLocaleManager ();
		}
		
		public string Name
		{
			get {
				/* We want to make the name of the mod appear in the right language too if the target language is selected. And while
				   we are at it, let's add some more languages to be polite to speakers of other language who are trying our mod
				   for whatever reason. */
				ColossalFramework.SavedString lang_setting = new ColossalFramework.SavedString("localeID", "gameSettings");
				switch (lang_setting.value) {
					case "de":
						return "Italienisch Übersetzung Mod";
					case "es":
						return "Mod Traducción Italiano";
					case "fr":
						return "Mod Localisation Italienne";
					case "it":
						return "Mod traduzione Italiana";
					case "nl":
						return "taliaanse vertaling Mod";
					default:
						return "Italian localization Mod";
				}
			}
		}

		public string Description
		{
			get {
				/* We want to make the description of the mod appear in the right language too if the target language is selected. And while
				   we are at it, let's add some more languages to be polite to speakers of other language who are trying our mod
				   for whatever reason. */
				ColossalFramework.SavedString lang_setting = new ColossalFramework.SavedString("localeID", "gameSettings");
				switch (lang_setting.value) {
					case "de":
						return "Italienische Ubersetzung von Cities: Skylines, durch BopItlia.";
					case "es":
						return "Traducción italiana de Cities: Skylines, por BopItlia.";
					case "fr":
						return "Traduction italienne des Cities: Skylines, par BopItlia.";
					case "it":
						return "Traduzione Italiana Cities: Skyline di BopItlia.";
					case "nl":
						return "Italiaanse vertaling van Cities: Skylines, door BopItlia.";
					default:
						return "Italian Localization of Cities:Skylines, by BopItlia.";
				}
			}
		}
	}
}
Ho quindi scaricato Ubuntu dallo Store Microsoft e provato a lanciare il comando make ricevendo il seguente errore

Codice: Seleziona tutto

mcs -target:library -r:ColossalManaged.dll -r:ICities.dll -r:Assembly-CSharp.dll -codepage:utf8 -resource:it.locale,Mod_Lang_IT.it.locale Mod_Lang_IT.cs
error CS0009: Metadata file `/home/staibuz/Traduzione/ColossalManaged.dll' does not contain valid metadata
error CS0009: Metadata file `/home/staibuz/Traduzione/ICities.dll' does not contain valid metadata
error CS0009: Metadata file `/home/staibuz/Traduzione/Assembly-CSharp.dll' does not contain valid metadata
Compilation failed: 3 error(s), 0 warnings
Makefile:2: recipe for target 'Mod_Lang_IT.dll' failed
make: *** [Mod_Lang_IT.dll] Error 1
staibuz
Prode Principiante
Messaggi: 11
Iscrizione: martedì 22 ottobre 2019, 18:39
Distribuzione: Ubuntu 18.04.3 LTS
Sesso: Maschile

Re: Problemi con progetto

Messaggio da staibuz »

Non c'è proprio nessuno che possa aiutarmi?
Avatar utente
Stealth
Tenace Tecnocrate
Tenace Tecnocrate
Messaggi: 17348
Iscrizione: martedì 31 gennaio 2006, 22:55
Desktop: Gnome
Distribuzione: Ubuntu 22.04 LTS

Re: Problemi con progetto

Messaggio da Stealth »

Ho chiesto lo spostamento in "programmazione" dove, forse, avresti qualche possibilità in più. Sempre se riterranno di farlo, chiaramente
Avatar utente
giulux
Amministratore
Amministratore
Messaggi: 25426
Iscrizione: domenica 10 gennaio 2010, 12:17
Desktop: ubuntu 18.04
Distribuzione: Ubuntu 18.04.3 LTS x86_64
Sesso: Maschile
Località: Roma

Re: Problemi con progetto

Messaggio da giulux »

Spostato.
"Non è una segno di buona salute l'essere ben adattato ad una società malata". (Jiddu Krishnarmurti)
staibuz
Prode Principiante
Messaggi: 11
Iscrizione: martedì 22 ottobre 2019, 18:39
Distribuzione: Ubuntu 18.04.3 LTS
Sesso: Maschile

Re: Problemi con progetto

Messaggio da staibuz »

Grazie speriamo
Avatar utente
willy54
Rampante Reduce
Rampante Reduce
Messaggi: 6063
Iscrizione: lunedì 18 dicembre 2017, 21:42
Desktop: Xfce, Xorg, Plasma
Distribuzione: Ubuntu studio,Ubuntu, Kubuntu 18.04
Sesso: Maschile
Località: Castell'Alfero (AT)
Contatti:

Re: Problemi con progetto

Messaggio da willy54 »

Considerando che stai utilizzando C# (sharp) il mio consiglio è di compilarlo con Microsoft Code che esiste anche per Linux anche se in verità qualche problema lo da, oppure in windows con Visual Studio .
Non so se esistono altri compilatori ubuntu compatibili per C#, forse Eclipse mi sembra abbia un compilatore per C#, ma mai utilizzato quindi non conosco prestazioni e problemi, io uso entrambi i programmi Microsoft ma da Windows.
Code su Ubuntu 18.04 lo avevo installato ma a seguito di alcuni problemi ho desistito e continuo ad utilizzare ma da win.
Hp Pavilon 15-CS2093nl Win10, UbuntuStudio 20.04.1 caratteristiche
Toshiba Satellite A660 11M Win7, Win10, Ubuntu 18.04 LTS- Kubuntu 18.04 LTS gparted sda inxi -Fz
disattivare Avvio rapido in Windows10 Installazione su pc Uefi download/file.php?id=31104 -- download/file.php?id=33560
staibuz
Prode Principiante
Messaggi: 11
Iscrizione: martedì 22 ottobre 2019, 18:39
Distribuzione: Ubuntu 18.04.3 LTS
Sesso: Maschile

Re: Problemi con progetto

Messaggio da staibuz »

Non credo sia un problema di compilatore
Ho installato mono (vedi allegato)
E neanche di codice.
Ho seguito le istruzioni passo passo.

Forse mi manca qualche programma o forse devo modificare i permessi ai tre file dll presenti nella cartella.

Qui il link ai file del progetto:
https://drive.google.com/drive/folders/1mfi1MhEZFSzT3W_N8IJwHJULVwg9GUOJ?usp=sharing
Avatar utente
willy54
Rampante Reduce
Rampante Reduce
Messaggi: 6063
Iscrizione: lunedì 18 dicembre 2017, 21:42
Desktop: Xfce, Xorg, Plasma
Distribuzione: Ubuntu studio,Ubuntu, Kubuntu 18.04
Sesso: Maschile
Località: Castell'Alfero (AT)
Contatti:

Re: Problemi con progetto

Messaggio da willy54 »

Cedo la parola , mai utilizzato mono.
Hp Pavilon 15-CS2093nl Win10, UbuntuStudio 20.04.1 caratteristiche
Toshiba Satellite A660 11M Win7, Win10, Ubuntu 18.04 LTS- Kubuntu 18.04 LTS gparted sda inxi -Fz
disattivare Avvio rapido in Windows10 Installazione su pc Uefi download/file.php?id=31104 -- download/file.php?id=33560
staibuz
Prode Principiante
Messaggi: 11
Iscrizione: martedì 22 ottobre 2019, 18:39
Distribuzione: Ubuntu 18.04.3 LTS
Sesso: Maschile

Re: Problemi con progetto

Messaggio da staibuz »

staibuz
Prode Principiante
Messaggi: 11
Iscrizione: martedì 22 ottobre 2019, 18:39
Distribuzione: Ubuntu 18.04.3 LTS
Sesso: Maschile

Re: Problemi con progetto

Messaggio da staibuz »

Il mio quesito non merita neanche una risposta?
Avatar utente
nuzzopippo
Entusiasta Emergente
Entusiasta Emergente
Messaggi: 1627
Iscrizione: giovedì 12 ottobre 2006, 11:34

Re: Problemi con progetto

Messaggio da nuzzopippo »

Certo che la merita, e merita anche essere una risposta come si deve ... e qui, temo, casca l'asino, essendo c# una tecnologia Microsoft legata al mondo .NET, piuttosto "lontano" dal contesto "storico" di linux, molti di noi, io per primo, semplicemente, non se ne sono interessati e non sono in grado di darTi risposte attendibili.

Personalmente, so del progetto "Mono" ma non me ne sono mai interessato, per altro, son rimasto basito dalla Tua indicazione :
Ho quindi scaricato Ubuntu dallo Store Microsoft e provato a lanciare il comando make ricevendo il seguente errore
Non avendo nessun sistema microsoft disponibile da decenni (non l'adopero proprio) non so cosa possa essere una distribuzione ubuntu scaricata da uno "store" Microsoft ... comprenderai, quindi, la "difficoltà" di intervento che ne deriva.

Una sola domanda : hai provato ad installare su di una partizione o su di un altro computer od anche su di una macchina virtuale una distribuzione ubuntu ufficiale e provare li la Tua applicazione? Potrebbe anche essere un problema di librerie disponibili.

:ciao:

P.S. - il link da Te postato :
da errore 404 (pagina inesistente)

[Edit] Per altro, riletto tutto il Tuo primo post, al punto 6 delle istruzioni indica esplicitamente che quella in uso "non è la via ufficiale" e l'errore indicato ben tre volte
does not contain valid metadata
Fa supporre sia proprio in quel metodo "non ufficiale" il problema ,,, non conosco l'argomento e non ho idea di cosa stai facendo esattamente ma se hai disponibile la documentazione "ufficiale" dovresti consultarla e verificare eventuali deficienze tra quanto si aspetti nella dll e quanto presente, o in eccesso, in ciò che è stato realizzato.
Fatti non foste a viver come bruti ...
staibuz
Prode Principiante
Messaggi: 11
Iscrizione: martedì 22 ottobre 2019, 18:39
Distribuzione: Ubuntu 18.04.3 LTS
Sesso: Maschile

Re: Problemi con progetto

Messaggio da staibuz »

Scusa la risposta tardiva ma non ho ricevuto l'avviso via mail e leggo solo ora.
Una sola domanda : hai provato ad installare su di una partizione o su di un altro computer od anche su di una macchina virtuale una distribuzione ubuntu ufficiale e provare li la Tua applicazione? Potrebbe anche essere un problema di librerie disponibili.
No non ho provato questa soluzione
Domani con calma provo ad installarla su una partizione virtuale
Vediamo che succede

per quanto riguarda l'errore 404 è colpa mia ho spostato i file e mi sono dimenticato di aggiornare il link eccolo:
https://drive.google.com/open?id=1YTi9n ... -DQ8A3zbfO

al suo interno ci sono due cartelle una chiamata "Progetto originale" contiene i file originali e funzionanti (vedi link sotto riportato) e una chiamata "Mio progetto" che contiene i file da me modificati per adattarli alla lingua italiana.
[Edit] Per altro, riletto tutto il Tuo primo post, al punto 6 delle istruzioni indica esplicitamente che quella in uso "non è la via ufficiale" e l'errore indicato ben tre volte
does not contain valid metadata

Fa supporre sia proprio in quel metodo "non ufficiale" il problema ,,, non conosco l'argomento e non ho idea di cosa stai facendo esattamente ma se hai disponibile la documentazione "ufficiale" dovresti consultarla e verificare eventuali deficienze tra quanto si aspetti nella dll e quanto presente, o in eccesso, in ciò che è stato realizzato.


per quanto riguarda questo punto le istruzioni che ho allegato e che trovi nel file readme del link è l'unica documentazione "ufficiale" che posso produrre.

Quello che sto cercando di fare è convertire la traduzione di un gioco, cities skyline nello specifico, da ".locale" a".dll", che è l'unico modo per poter pubblicare la traduzione del gioco su Steam.
Il workshop del gioco infatti accetta solo il formato ".dll" per quanto riguarda le traduzioni.
Non sussistono problemi per tutti gli altri file/oggetti modificabili del gioco.

Allego anche la pagina del progetto originale:
[url=https://steamcommunity.com/sharedfiles/ ... traduzione[/url]

Anticipo anche che l'autore è irraggiungibile così come la fonte del progetto (la cita da qualche parte ma ora non la trovo forse nel readme)
Avatar utente
willy54
Rampante Reduce
Rampante Reduce
Messaggi: 6063
Iscrizione: lunedì 18 dicembre 2017, 21:42
Desktop: Xfce, Xorg, Plasma
Distribuzione: Ubuntu studio,Ubuntu, Kubuntu 18.04
Sesso: Maschile
Località: Castell'Alfero (AT)
Contatti:

Re: Problemi con progetto

Messaggio da willy54 »

Per poter compilare quella dll hai necessità di avere anche le librerie a cui la dll fa riferimento .
using ICities;
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using ColossalFramework.Plugins;
using System.Reflection;
Queste librerie sono presenti in MONO ? Se si potrai compilare ma se ne manca anche solo una la DLL non sarà compilabile .
Questi errori dicono che mancano dei valori a cui le Dll fanno riferimento .
error CS0009: Metadata file `/home/staibuz/Traduzione/ColossalManaged.dll' does not contain valid metadata
error CS0009: Metadata file `/home/staibuz/Traduzione/ICities.dll' does not contain valid metadata
error CS0009: Metadata file `/home/staibuz/Traduzione/Assembly-CSharp.dll' does not contain valid metadata
Come già detto trattandosi le dll file di windows, e che mono potrebbe non essere aggiornato al framework di windows ritengo più opportuno compilare con un programma per windows.
In particolare ritengo che
ColossalManaged.dll
ICities.dll
contengano dei riferimenti ad altre librerie o classi del programma globale.
Se hai il codice sorgente di quelle due librerie dovresti trovare all'inizio del listato le librerie utilizzate.
Hp Pavilon 15-CS2093nl Win10, UbuntuStudio 20.04.1 caratteristiche
Toshiba Satellite A660 11M Win7, Win10, Ubuntu 18.04 LTS- Kubuntu 18.04 LTS gparted sda inxi -Fz
disattivare Avvio rapido in Windows10 Installazione su pc Uefi download/file.php?id=31104 -- download/file.php?id=33560
staibuz
Prode Principiante
Messaggi: 11
Iscrizione: martedì 22 ottobre 2019, 18:39
Distribuzione: Ubuntu 18.04.3 LTS
Sesso: Maschile

Re: Problemi con progetto

Messaggio da staibuz »

Scusa la risposta tardiva ma non mi arrivano le notifiche via mail (già verificato nelle impostazioni sono attivate)
Comunque ho montato su virtual box Ubuntu 19.10
Fatto tutti gli aggiornamenti
Installato mono
ecc...
Copiato tutti i file del progetto e aggiunto i file dll UnityEngine UnityEngine.Networking UnityEngine.UI Mono.Posix Mono.Security

lanciato da terminale il comando make

il risultato è

Codice: Seleziona tutto

make
mcs -target:library -r:ColossalManaged.dll -r:ICities.dll -r:Assembly-CSharp.dll -codepage:utf8 -resource:it.locale,Mod_Lang_IT.it.locale Mod_Lang_IT.cs
Mod_Lang_IT.cs(111,24): error CS0012: The type `UnityEngine.Component' is defined in an assembly that is not referenced. Consider adding a reference to assembly `UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
/home/andrea/Scrivania/Traduzione/ColossalManaged.dll (Location of the symbol related to previous error)
Mod_Lang_IT.cs(179,6): error CS0012: The type `UnityEngine.MonoBehaviour' is defined in an assembly that is not referenced. Consider adding a reference to assembly `UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
/home/andrea/Scrivania/Traduzione/ColossalManaged.dll (Location of the symbol related to previous error)
Compilation failed: 2 error(s), 0 warnings
make: *** [Makefile:2: Mod_Lang_IT.dll] Error 1
Come lo risolvo?
staibuz
Prode Principiante
Messaggi: 11
Iscrizione: martedì 22 ottobre 2019, 18:39
Distribuzione: Ubuntu 18.04.3 LTS
Sesso: Maschile

Re: Problemi con progetto

Messaggio da staibuz »

Qualcuno mi può aiutare? a me basta poter trasformare il file della traduzione (fomato. cs) in un file .dll o altro formato che sia pubblicabile poi sul workshop Steam di Citiesskyline.
Attendo consigli
Avatar utente
willy54
Rampante Reduce
Rampante Reduce
Messaggi: 6063
Iscrizione: lunedì 18 dicembre 2017, 21:42
Desktop: Xfce, Xorg, Plasma
Distribuzione: Ubuntu studio,Ubuntu, Kubuntu 18.04
Sesso: Maschile
Località: Castell'Alfero (AT)
Contatti:

Re: Problemi con progetto

Messaggio da willy54 »

Come già detto da altri su questo sito i programmatori sono soliti utilizzare phyton che non ha un compilatore C# , mono mi sa che non è aggiornato da tempo se poi hai scaricato dai repo ufficiali sarà ancora più antiquato, come il resto dei programmi.
Se fai una ricerca ICITIES.DLL trovi un casino di documentazione dove esplicitamente dicono di usare Visual Studio dove sono presenti nativamente tutte le librerie che ti ho segnalato, ci sono anche le istruzioni per reperire le intrinseche del programma come Icities.dll ed altre a cui il programma fa riferimento.
The type `UnityEngine.Component' is defined in an assembly that is not referenced.
ti dice che le referenze (dipendenze del modulo) sono referenziate in un altro modulo ---> altra dll a cui fa riferimento il modulo.
Quindi in base alle istruzioni che puoi trovare on line devi prima procurarti tutti i moduli del programma in quale cartella scaricarli lo puoi trovare nelle istruzioni .
Come consiglio installati Windows e Visual studio almeno vers.2015 per avere C#.dll almeno alla versione 3 ma meglio ancora la versione 4, penso che anche la versione gratuita possa andare bene, la versione pro ha solo maggiori facilitazioni per il debug che a te non dovrebbero servire.
Io non uso come detto ne Mono ne altri compilatori sotto Ubuntu , per programmare uso solo Visual Studio e Code ma sotto windows.
Alternativa può come detto essere Code ma su ubuntu/X da qualche problema o Eclipse .
Questo è tutto l'aiuto che posso darti.
Hp Pavilon 15-CS2093nl Win10, UbuntuStudio 20.04.1 caratteristiche
Toshiba Satellite A660 11M Win7, Win10, Ubuntu 18.04 LTS- Kubuntu 18.04 LTS gparted sda inxi -Fz
disattivare Avvio rapido in Windows10 Installazione su pc Uefi download/file.php?id=31104 -- download/file.php?id=33560
staibuz
Prode Principiante
Messaggi: 11
Iscrizione: martedì 22 ottobre 2019, 18:39
Distribuzione: Ubuntu 18.04.3 LTS
Sesso: Maschile

Re: Problemi con progetto

Messaggio da staibuz »

Grazie nuovamente per avermi risposto.
Seguirò la strada consigliata.
Approfitto della tua disponibilità per un ulteriore chiarimento: nelle istruzioni che ho allegato l'autore fa esplicitamente riferimento a linux e quindi,se le mie informazioni sono corrette, ciò significa che ha programmato in c. il C#, phyton, ecc.. non sono forse una versione più moderna di C?
Ciao e Grazie ancora
Avatar utente
willy54
Rampante Reduce
Rampante Reduce
Messaggi: 6063
Iscrizione: lunedì 18 dicembre 2017, 21:42
Desktop: Xfce, Xorg, Plasma
Distribuzione: Ubuntu studio,Ubuntu, Kubuntu 18.04
Sesso: Maschile
Località: Castell'Alfero (AT)
Contatti:

Re: Problemi con progetto

Messaggio da willy54 »

C# è una via di mezzo tra C+ e Java ogni linguaggio di programmazione richiede i suoi compilatori.
C# a detta di molti programmatori molto più esperti di me, è il classico aborto inventato come specchio per le allodole per avvicinare programmatori al C+.
Nella documentazione che ho visualizzato ieri sera , si ho trovato riferimenti a Linux ma solo riguardanti il funzionamento del programma completo, nessuno relativo alla compilazione in C ho altri programmi sotto Linux.
Potrà anche esserci ma certamente non vado a leggere tutta la documentazione preposta al programma, in quanto lo stesso mi è proprio indifferente ho solo letto in traduzione veloce la documentazione ufficiale.
Hp Pavilon 15-CS2093nl Win10, UbuntuStudio 20.04.1 caratteristiche
Toshiba Satellite A660 11M Win7, Win10, Ubuntu 18.04 LTS- Kubuntu 18.04 LTS gparted sda inxi -Fz
disattivare Avvio rapido in Windows10 Installazione su pc Uefi download/file.php?id=31104 -- download/file.php?id=33560
staibuz
Prode Principiante
Messaggi: 11
Iscrizione: martedì 22 ottobre 2019, 18:39
Distribuzione: Ubuntu 18.04.3 LTS
Sesso: Maschile

Re: Problemi con progetto

Messaggio da staibuz »

Ok.
Tutto quello che ho postato serve per circostanziare il problema e ottenere una risposta in merito.
Comunque sto risolvendo da solo usando Visual Studio
Avatar utente
willy54
Rampante Reduce
Rampante Reduce
Messaggi: 6063
Iscrizione: lunedì 18 dicembre 2017, 21:42
Desktop: Xfce, Xorg, Plasma
Distribuzione: Ubuntu studio,Ubuntu, Kubuntu 18.04
Sesso: Maschile
Località: Castell'Alfero (AT)
Contatti:

Re: Problemi con progetto

Messaggio da willy54 »

Sicuramente utilizzando i programmi nativi e preposti allo scopo ti sarà molto più facile, utilizzare dei surrogati spesso porta so,lo a grandi perdite di tempo, dopo tutto tanto C# quanto il formato dll sono nativi Microsoft .
In Visual studio qualche aiuto posso dartelo anche se non mi sono mai lanciato nella programmazione in C# , ma uso prevalentemente Visual Basic e raramente C, in quanto anche in Visual Basic alcuni problemi non sono risolvibili per la mancanza di alcune Api e librerie.
Hp Pavilon 15-CS2093nl Win10, UbuntuStudio 20.04.1 caratteristiche
Toshiba Satellite A660 11M Win7, Win10, Ubuntu 18.04 LTS- Kubuntu 18.04 LTS gparted sda inxi -Fz
disattivare Avvio rapido in Windows10 Installazione su pc Uefi download/file.php?id=31104 -- download/file.php?id=33560
Scrivi risposta

Ritorna a “Programmazione”

Chi c’è in linea

Visualizzano questa sezione: 0 utenti iscritti e 3 ospiti